diff options
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 5 | ||||
| -rw-r--r-- | services/surfaceflinger/LayerProtoHelper.cpp | 8 | ||||
| -rw-r--r-- | services/surfaceflinger/LayerProtoHelper.h | 1 | ||||
| -rw-r--r-- | services/surfaceflinger/layerproto/layers.proto | 6 |
4 files changed, 20 insertions, 0 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index c7eb9c391a..6fd1629502 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1930,6 +1930,11 @@ void Layer::writeToProtoDrawingState(LayerProto* layerInfo, uint32_t traceFlags) [&]() { return layerInfo->mutable_visible_region(); }); LayerProtoHelper::writeToProto(surfaceDamageRegion, [&]() { return layerInfo->mutable_damage_region(); }); + + if (hasColorTransform()) { + LayerProtoHelper::writeToProto(getColorTransform(), + layerInfo->mutable_color_transform()); + } } if (traceFlags & SurfaceTracing::TRACE_EXTRA) { diff --git a/services/surfaceflinger/LayerProtoHelper.cpp b/services/surfaceflinger/LayerProtoHelper.cpp index c94e439659..b4022704d5 100644 --- a/services/surfaceflinger/LayerProtoHelper.cpp +++ b/services/surfaceflinger/LayerProtoHelper.cpp @@ -155,5 +155,13 @@ void LayerProtoHelper::writeToProto( } } +void LayerProtoHelper::writeToProto(const mat4 matrix, ColorTransformProto* colorTransformProto) { + for (int i = 0; i < mat4::ROW_SIZE; i++) { + for (int j = 0; j < mat4::COL_SIZE; j++) { + colorTransformProto->add_val(matrix[i][j]); + } + } +} + } // namespace surfaceflinger } // namespace android diff --git a/services/surfaceflinger/LayerProtoHelper.h b/services/surfaceflinger/LayerProtoHelper.h index 1754a3f2d7..502238d389 100644 --- a/services/surfaceflinger/LayerProtoHelper.h +++ b/services/surfaceflinger/LayerProtoHelper.h @@ -43,6 +43,7 @@ public: static void writeToProto(const InputWindowInfo& inputInfo, const wp<Layer>& touchableRegionBounds, std::function<InputWindowInfoProto*()> getInputWindowInfoProto); + static void writeToProto(const mat4 matrix, ColorTransformProto* colorTransformProto); }; } // namespace surfaceflinger diff --git a/services/surfaceflinger/layerproto/layers.proto b/services/surfaceflinger/layerproto/layers.proto index 9ad9b91a9a..23df1bbd2c 100644 --- a/services/surfaceflinger/layerproto/layers.proto +++ b/services/surfaceflinger/layerproto/layers.proto @@ -101,6 +101,7 @@ message LayerProto { // length of the shadow to draw around the layer, it may be set on the // layer or set by a parent layer. float shadow_radius = 49; + ColorTransformProto color_transform = 50; } message PositionProto { @@ -181,3 +182,8 @@ message InputWindowInfoProto { bool replace_touchable_region_with_crop = 14; RectProto touchable_region_crop = 15; } + +message ColorTransformProto { + // This will be a 4x4 matrix of float values + repeated float val = 1; +}
\ No newline at end of file |