summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp32
-rw-r--r--services/surfaceflinger/SurfaceFlinger.h2
2 files changed, 0 insertions, 34 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 4aea3697f4..a14ca2d2a2 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -734,24 +734,6 @@ void SurfaceFlinger::init() {
ALOGE("Run StartPropertySetThread failed!");
}
- // This is a hack. Per definition of getDataspaceSaturationMatrix, the returned matrix
- // is used to saturate legacy sRGB content. However, to make sure the same color under
- // Display P3 will be saturated to the same color, we intentionally break the API spec
- // and apply this saturation matrix on Display P3 content. Unless the risk of applying
- // such saturation matrix on Display P3 is understood fully, the API should always return
- // identify matrix.
- mEnhancedSaturationMatrix =
- getHwComposer().getDataspaceSaturationMatrix(*display->getId(), Dataspace::SRGB_LINEAR);
-
- // we will apply this on Display P3.
- if (mEnhancedSaturationMatrix != mat4()) {
- ColorSpace srgb(ColorSpace::sRGB());
- ColorSpace displayP3(ColorSpace::DisplayP3());
- mat4 srgbToP3 = mat4(ColorSpaceConnector(srgb, displayP3).getTransform());
- mat4 p3ToSrgb = mat4(ColorSpaceConnector(displayP3, srgb).getTransform());
- mEnhancedSaturationMatrix = srgbToP3 * mEnhancedSaturationMatrix * p3ToSrgb;
- }
-
ALOGV("Done initializing");
}
@@ -3085,7 +3067,6 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<DisplayDevice>& display) {
mat4 colorMatrix;
bool applyColorMatrix = false;
- bool needsEnhancedColorMatrix = false;
// Framebuffer will live in this scope for GPU composition.
std::unique_ptr<renderengine::BindNativeBufferAsFramebuffer> fbo;
@@ -3132,16 +3113,6 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<DisplayDevice>& display) {
colorMatrix = mDrawingState.colorMatrix;
}
- // The current enhanced saturation matrix is designed to enhance Display P3,
- // thus we only apply this matrix when the render intent is not colorimetric
- // and the output color space is Display P3.
- needsEnhancedColorMatrix =
- (display->getActiveRenderIntent() >= RenderIntent::ENHANCE &&
- outputDataspace == Dataspace::DISPLAY_P3);
- if (needsEnhancedColorMatrix) {
- colorMatrix *= mEnhancedSaturationMatrix;
- }
-
display->setViewportAndProjection();
// Never touch the framebuffer if we don't have any framebuffer layers
@@ -3216,9 +3187,6 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<DisplayDevice>& display) {
tmpMatrix = mDrawingState.colorMatrix;
}
tmpMatrix *= layer->getColorTransform();
- if (needsEnhancedColorMatrix) {
- tmpMatrix *= mEnhancedSaturationMatrix;
- }
getRenderEngine().setColorTransform(tmpMatrix);
} else {
getRenderEngine().setColorTransform(colorMatrix);
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 9f520583fe..4977ca08d2 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -986,8 +986,6 @@ private:
std::thread::id mMainThreadId;
DisplayColorSetting mDisplayColorSetting = DisplayColorSetting::ENHANCED;
- // Applied on Display P3 layers when the render intent is non-colorimetric.
- mat4 mEnhancedSaturationMatrix;
ui::Dataspace mDefaultCompositionDataspace;
ui::Dataspace mWideColorGamutCompositionDataspace;