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

Review-Url: https://codereview.chromium.org/1957433002
This commit is contained in:
robertphillips 2016-05-05 12:38:03 -07:00 committed by Commit bot
parent a8d0d6c8ba
commit 4e30f27164
2 changed files with 6 additions and 2 deletions

View File

@ -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;

View File

@ -1784,7 +1784,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;
}