Loading services/surfaceflinger/CompositionEngine/include/compositionengine/CompositionRefreshArgs.h +10 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <compositionengine/Display.h> #include <compositionengine/Layer.h> #include <compositionengine/OutputColorSetting.h> namespace android::compositionengine { Loading @@ -42,6 +43,15 @@ struct CompositionRefreshArgs { // If true, forces the entire display to be considered dirty and repainted bool repaintEverything{false}; // Controls how the color mode is chosen for an output OutputColorSetting outputColorSetting{OutputColorSetting::kEnhanced}; // If not Dataspace::UNKNOWN, overrides the dataspace on each output ui::Dataspace colorSpaceAgnosticDataspace{ui::Dataspace::UNKNOWN}; // Forces a color mode on the outputs being refreshed ui::ColorMode forceOutputColorMode{ui::ColorMode::NATIVE}; // If set, causes the dirty regions to flash with the delay std::optional<std::chrono::microseconds> devOptFlashDirtyRegionsDelay; }; Loading services/surfaceflinger/CompositionEngine/include/compositionengine/Output.h +11 −2 Original line number Diff line number Diff line Loading @@ -63,6 +63,13 @@ public: std::unordered_map<HWC2::Layer*, sp<Fence>> layerFences; }; struct ColorProfile { ui::ColorMode mode{ui::ColorMode::NATIVE}; ui::Dataspace dataspace{ui::Dataspace::UNKNOWN}; ui::RenderIntent renderIntent{ui::RenderIntent::COLORIMETRIC}; ui::Dataspace colorSpaceAgnosticDataspace{ui::Dataspace::UNKNOWN}; }; virtual ~Output(); // Returns true if the output is valid. This is meant to be checked post- Loading @@ -87,8 +94,7 @@ public: virtual void setColorTransform(const mat4&) = 0; // Sets the output color mode virtual void setColorMode(ui::ColorMode, ui::Dataspace, ui::RenderIntent, ui::Dataspace colorSpaceAgnosticDataspace) = 0; virtual void setColorProfile(const ColorProfile&) = 0; // Outputs a string with a state dump virtual void dump(std::string&) const = 0; Loading Loading @@ -153,6 +159,9 @@ public: // Takes (moves) the set of layers being released this frame. virtual ReleasedLayers takeReleasedLayers() = 0; // Updates the color mode used on this output virtual void updateColorProfile(const CompositionRefreshArgs&) = 0; // Signals that a frame is beginning on the output virtual void beginFrame() = 0; Loading services/surfaceflinger/CompositionEngine/include/compositionengine/OutputColorSetting.h 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once namespace android::compositionengine { enum class OutputColorSetting : int32_t { kManaged = 0, kUnmanaged = 1, kEnhanced = 2, }; } // namespace android::compositionengine No newline at end of file services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ public: // compositionengine::Output overrides void dump(std::string&) const override; void setColorTransform(const mat4&) override; void setColorMode(ui::ColorMode, ui::Dataspace, ui::RenderIntent, ui::Dataspace) override; void setColorProfile(const ColorProfile&) override; void chooseCompositionStrategy() override; bool getSkipColorTransform() const override; compositionengine::Output::FrameFences presentAndGetFrameFences() override; Loading services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Output.h +6 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ public: void setLayerStackFilter(uint32_t layerStackId, bool isInternal) override; void setColorTransform(const mat4&) override; void setColorMode(ui::ColorMode, ui::Dataspace, ui::RenderIntent, ui::Dataspace) override; void setColorProfile(const ColorProfile&) override; void dump(std::string&) const override; Loading Loading @@ -75,6 +75,8 @@ public: void setReleasedLayers(ReleasedLayers&&) override; ReleasedLayers takeReleasedLayers() override; void updateColorProfile(const compositionengine::CompositionRefreshArgs&) override; void beginFrame() override; void prepareFrame() override; void devOptRepaintFlash(const compositionengine::CompositionRefreshArgs&) override; Loading @@ -100,6 +102,9 @@ protected: private: void dirtyEntireOutput(); ui::Dataspace getBestDataspace(ui::Dataspace*, bool*) const; compositionengine::Output::ColorProfile pickColorProfile( const compositionengine::CompositionRefreshArgs&) const; const CompositionEngine& mCompositionEngine; Loading Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/CompositionRefreshArgs.h +10 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include <compositionengine/Display.h> #include <compositionengine/Layer.h> #include <compositionengine/OutputColorSetting.h> namespace android::compositionengine { Loading @@ -42,6 +43,15 @@ struct CompositionRefreshArgs { // If true, forces the entire display to be considered dirty and repainted bool repaintEverything{false}; // Controls how the color mode is chosen for an output OutputColorSetting outputColorSetting{OutputColorSetting::kEnhanced}; // If not Dataspace::UNKNOWN, overrides the dataspace on each output ui::Dataspace colorSpaceAgnosticDataspace{ui::Dataspace::UNKNOWN}; // Forces a color mode on the outputs being refreshed ui::ColorMode forceOutputColorMode{ui::ColorMode::NATIVE}; // If set, causes the dirty regions to flash with the delay std::optional<std::chrono::microseconds> devOptFlashDirtyRegionsDelay; }; Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/Output.h +11 −2 Original line number Diff line number Diff line Loading @@ -63,6 +63,13 @@ public: std::unordered_map<HWC2::Layer*, sp<Fence>> layerFences; }; struct ColorProfile { ui::ColorMode mode{ui::ColorMode::NATIVE}; ui::Dataspace dataspace{ui::Dataspace::UNKNOWN}; ui::RenderIntent renderIntent{ui::RenderIntent::COLORIMETRIC}; ui::Dataspace colorSpaceAgnosticDataspace{ui::Dataspace::UNKNOWN}; }; virtual ~Output(); // Returns true if the output is valid. This is meant to be checked post- Loading @@ -87,8 +94,7 @@ public: virtual void setColorTransform(const mat4&) = 0; // Sets the output color mode virtual void setColorMode(ui::ColorMode, ui::Dataspace, ui::RenderIntent, ui::Dataspace colorSpaceAgnosticDataspace) = 0; virtual void setColorProfile(const ColorProfile&) = 0; // Outputs a string with a state dump virtual void dump(std::string&) const = 0; Loading Loading @@ -153,6 +159,9 @@ public: // Takes (moves) the set of layers being released this frame. virtual ReleasedLayers takeReleasedLayers() = 0; // Updates the color mode used on this output virtual void updateColorProfile(const CompositionRefreshArgs&) = 0; // Signals that a frame is beginning on the output virtual void beginFrame() = 0; Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/OutputColorSetting.h 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once namespace android::compositionengine { enum class OutputColorSetting : int32_t { kManaged = 0, kUnmanaged = 1, kEnhanced = 2, }; } // namespace android::compositionengine No newline at end of file
services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h +1 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ public: // compositionengine::Output overrides void dump(std::string&) const override; void setColorTransform(const mat4&) override; void setColorMode(ui::ColorMode, ui::Dataspace, ui::RenderIntent, ui::Dataspace) override; void setColorProfile(const ColorProfile&) override; void chooseCompositionStrategy() override; bool getSkipColorTransform() const override; compositionengine::Output::FrameFences presentAndGetFrameFences() override; Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Output.h +6 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ public: void setLayerStackFilter(uint32_t layerStackId, bool isInternal) override; void setColorTransform(const mat4&) override; void setColorMode(ui::ColorMode, ui::Dataspace, ui::RenderIntent, ui::Dataspace) override; void setColorProfile(const ColorProfile&) override; void dump(std::string&) const override; Loading Loading @@ -75,6 +75,8 @@ public: void setReleasedLayers(ReleasedLayers&&) override; ReleasedLayers takeReleasedLayers() override; void updateColorProfile(const compositionengine::CompositionRefreshArgs&) override; void beginFrame() override; void prepareFrame() override; void devOptRepaintFlash(const compositionengine::CompositionRefreshArgs&) override; Loading @@ -100,6 +102,9 @@ protected: private: void dirtyEntireOutput(); ui::Dataspace getBestDataspace(ui::Dataspace*, bool*) const; compositionengine::Output::ColorProfile pickColorProfile( const compositionengine::CompositionRefreshArgs&) const; const CompositionEngine& mCompositionEngine; Loading