Loading services/surfaceflinger/CompositionEngine/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ cc_test { srcs: [ "tests/planner/CachedSetTest.cpp", "tests/planner/FlattenerTest.cpp", "tests/planner/LayerStateTest.cpp", "tests/CompositionEngineTest.cpp", "tests/DisplayColorProfileTest.cpp", "tests/DisplayTest.cpp", Loading services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/LayerState.h +6 −13 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ using LayerId = int32_t; // clang-format off enum class LayerStateField : uint32_t { None = 0u, Id = 1u << 0, Name = 1u << 1, DisplayFrame = 1u << 2, Loading Loading @@ -173,8 +174,12 @@ public: // Returns which fields were updated Flags<LayerStateField> update(compositionengine::OutputLayer*); // Computes a hash for this LayerState. // The hash is only computed from NonUniqueFields. size_t getHash(Flags<LayerStateField> skipFields) const; // Returns the bit-set of differing fields between this LayerState and another LayerState. // This bit-set is based on NonUniqueFields only Flags<LayerStateField> getDifferingFields(const LayerState& other, Flags<LayerStateField> skipFields) const; Loading Loading @@ -280,19 +285,7 @@ private: // Output-independent per-frame state OutputLayerState<mat4, LayerStateField::ColorTransform> mColorTransform{[](auto layer) { const auto state = layer->getLayerFE().getCompositionState(); return state->colorTransformIsIdentity ? mat4{} : state->colorTransform; }, [](const mat4& mat) { using namespace std::string_literals; std::vector<std::string> split = base::Split(std::string(mat.asString().string()), "\n"s); split.pop_back(); // Strip the last (empty) line return split; }}; OutputLayerState<mat4, LayerStateField::ColorTransform> mColorTransform; // TODO(b/180638831): Surface damage Loading services/surfaceflinger/CompositionEngine/src/planner/LayerState.cpp +20 −1 Original line number Diff line number Diff line Loading @@ -16,9 +16,28 @@ #include <compositionengine/impl/planner/LayerState.h> namespace { extern "C" const char* __attribute__((unused)) __asan_default_options() { return "detect_container_overflow=0"; } } // namespace namespace android::compositionengine::impl::planner { LayerState::LayerState(compositionengine::OutputLayer* layer) : mOutputLayer(layer) { LayerState::LayerState(compositionengine::OutputLayer* layer) : mOutputLayer(layer), mColorTransform({[](auto layer) { const auto state = layer->getLayerFE().getCompositionState(); return state->colorTransformIsIdentity ? mat4{} : state->colorTransform; }, [](const mat4& mat) { using namespace std::string_literals; std::vector<std::string> split = base::Split(std::string(mat.asString().string()), "\n"s); split.pop_back(); // Strip the last (empty) line return split; }}) { update(layer); } Loading services/surfaceflinger/CompositionEngine/tests/planner/LayerStateTest.cpp 0 → 100644 +1020 −0 File added.Preview size limit exceeded, changes collapsed. Show changes Loading
services/surfaceflinger/CompositionEngine/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ cc_test { srcs: [ "tests/planner/CachedSetTest.cpp", "tests/planner/FlattenerTest.cpp", "tests/planner/LayerStateTest.cpp", "tests/CompositionEngineTest.cpp", "tests/DisplayColorProfileTest.cpp", "tests/DisplayTest.cpp", Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/impl/planner/LayerState.h +6 −13 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ using LayerId = int32_t; // clang-format off enum class LayerStateField : uint32_t { None = 0u, Id = 1u << 0, Name = 1u << 1, DisplayFrame = 1u << 2, Loading Loading @@ -173,8 +174,12 @@ public: // Returns which fields were updated Flags<LayerStateField> update(compositionengine::OutputLayer*); // Computes a hash for this LayerState. // The hash is only computed from NonUniqueFields. size_t getHash(Flags<LayerStateField> skipFields) const; // Returns the bit-set of differing fields between this LayerState and another LayerState. // This bit-set is based on NonUniqueFields only Flags<LayerStateField> getDifferingFields(const LayerState& other, Flags<LayerStateField> skipFields) const; Loading Loading @@ -280,19 +285,7 @@ private: // Output-independent per-frame state OutputLayerState<mat4, LayerStateField::ColorTransform> mColorTransform{[](auto layer) { const auto state = layer->getLayerFE().getCompositionState(); return state->colorTransformIsIdentity ? mat4{} : state->colorTransform; }, [](const mat4& mat) { using namespace std::string_literals; std::vector<std::string> split = base::Split(std::string(mat.asString().string()), "\n"s); split.pop_back(); // Strip the last (empty) line return split; }}; OutputLayerState<mat4, LayerStateField::ColorTransform> mColorTransform; // TODO(b/180638831): Surface damage Loading
services/surfaceflinger/CompositionEngine/src/planner/LayerState.cpp +20 −1 Original line number Diff line number Diff line Loading @@ -16,9 +16,28 @@ #include <compositionengine/impl/planner/LayerState.h> namespace { extern "C" const char* __attribute__((unused)) __asan_default_options() { return "detect_container_overflow=0"; } } // namespace namespace android::compositionengine::impl::planner { LayerState::LayerState(compositionengine::OutputLayer* layer) : mOutputLayer(layer) { LayerState::LayerState(compositionengine::OutputLayer* layer) : mOutputLayer(layer), mColorTransform({[](auto layer) { const auto state = layer->getLayerFE().getCompositionState(); return state->colorTransformIsIdentity ? mat4{} : state->colorTransform; }, [](const mat4& mat) { using namespace std::string_literals; std::vector<std::string> split = base::Split(std::string(mat.asString().string()), "\n"s); split.pop_back(); // Strip the last (empty) line return split; }}) { update(layer); } Loading
services/surfaceflinger/CompositionEngine/tests/planner/LayerStateTest.cpp 0 → 100644 +1020 −0 File added.Preview size limit exceeded, changes collapsed. Show changes