summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/SkiaPipeline.cpp
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2018-10-19 15:55:33 -0400
committerDerek Sollenberger <djsollen@google.com>2018-11-07 20:56:28 +0000
commitd01b5916d8b512ee4df8d749022c10419b58b4b2 (patch)
tree734292de80f5033a1cc32cede1d916d5806b8482 /libs/hwui/pipeline/skia/SkiaPipeline.cpp
parentfe878c454ad92f98db770eb51a55ac14ca7fcd08 (diff)
Set the color space to sRGB on the Surface and remove colorFilter.
Also for a canvas wrapping a bitmap the colorspace of the bitmap will be used to correctly blend content. Test: CtsUiRenderingTestCases Bug: 111436479 Change-Id: I63ad7a30605a7f725cc0ef4716d42ea978fb03e3
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaPipeline.cpp')
-rw-r--r--libs/hwui/pipeline/skia/SkiaPipeline.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.cpp b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
index 2dfe7c71ca1b..7a255c15bf5f 100644
--- a/libs/hwui/pipeline/skia/SkiaPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
@@ -169,7 +169,7 @@ bool SkiaPipeline::createOrUpdateLayer(RenderNode* node, const DamageAccumulator
if (!layer || layer->width() != surfaceWidth || layer->height() != surfaceHeight) {
SkImageInfo info;
info = SkImageInfo::Make(surfaceWidth, surfaceHeight, getSurfaceColorType(),
- kPremul_SkAlphaType);
+ kPremul_SkAlphaType, getSurfaceColorSpace());
SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
SkASSERT(mRenderThread.getGrContext() != nullptr);
node->setLayerSurface(SkSurface::MakeRenderTarget(mRenderThread.getGrContext(),
@@ -204,8 +204,7 @@ void SkiaPipeline::prepareToDraw(const RenderThread& thread, Bitmap* bitmap) {
GrContext* context = thread.getGrContext();
if (context) {
ATRACE_FORMAT("Bitmap#prepareToDraw %dx%d", bitmap->width(), bitmap->height());
- sk_sp<SkColorFilter> colorFilter;
- auto image = bitmap->makeImage(&colorFilter);
+ auto image = bitmap->makeImage();
if (image.get() && !bitmap->isHardware()) {
SkImage_pinAsTexture(image.get(), context);
SkImage_unpinAsTexture(image.get(), context);