From 74e9a4dcd3772fccfc26b148e43cfcf4e084093f Mon Sep 17 00:00:00 2001 From: robertphillips Date: Mon, 9 May 2016 05:12:18 -0700 Subject: [PATCH] Reland of Disable layer hoisting for non-8888 canvases (patchset #1 id:1 of https://codereview.chromium.org/1961483002/ ) Reason for revert: This CL was not the culprit in the perf regression. Original issue's description: > Revert of Disable layer hoisting for non-8888 canvases (patchset #2 id:20001 of https://codereview.chromium.org/1957433002/ ) > > Reason for revert: > Experimental revert to investigate perf regression > > Original issue's description: > > Disable layer hoisting for non-8888 canvases > > > > This just stops the bleeding. A real fix would propagate the canvas' backing type down to the layer hoister. > > > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1957433002 > > > > Committed: https://skia.googlesource.com/skia/+/4e30f27164179d344f0c8efa9a691d1bc9a53e3f > > TBR=bsalomon@google.com > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Committed: https://skia.googlesource.com/skia/+/6b53b9daeb2137a91d8ddb8e890d66c702bfbaa3 TBR=bsalomon@google.com # Not skipping CQ checks because original CL landed more than 1 days ago. Review-Url: https://codereview.chromium.org/1962603002 --- src/core/SkMultiPictureDraw.cpp | 4 +++- src/gpu/SkGpuDevice.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/SkMultiPictureDraw.cpp b/src/core/SkMultiPictureDraw.cpp index 26e446d..40d93b1 100644 --- a/src/core/SkMultiPictureDraw.cpp +++ b/src/core/SkMultiPictureDraw.cpp @@ -124,7 +124,9 @@ void SkMultiPictureDraw::draw(bool flush) { // we only expect 1 context for all the canvases SkASSERT(data.fCanvas->getGrContext() == context); - if (!data.fPaint) { + if (!data.fPaint && + (kRGBA_8888_SkColorType == data.fCanvas->imageInfo().colorType() || + kBGRA_8888_SkColorType == data.fCanvas->imageInfo().colorType())) { SkRect clipBounds; if (!data.fCanvas->getClipBounds(&clipBounds)) { continue; diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 98da472..ba5848b 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1782,7 +1782,9 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture ASSERT_SINGLE_OWNER #ifndef SK_IGNORE_GPU_LAYER_HOISTING // todo: should handle this natively - if (paint) { + if (paint || + (kRGBA_8888_SkColorType != mainCanvas->imageInfo().colorType() && + kBGRA_8888_SkColorType != mainCanvas->imageInfo().colorType())) { return false; } -- 2.7.4