Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: src/gpu/GrLayerHoister.cpp

Issue 783493002: Change clear() to respect the clip (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRecords.h ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrLayerHoister.cpp
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index a17c7ddf97cb95dbc35331e44884a0b89dcb56f5..5d2d5493b44dec7e22247c10fd3a4dd087ddb4c8 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -193,10 +193,6 @@ void GrLayerHoister::DrawLayersToAtlas(GrContext* context,
SkCanvas* atlasCanvas = surface->getCanvas();
- SkPaint clearPaint;
- clearPaint.setColor(SK_ColorTRANSPARENT);
- clearPaint.setXfermode(SkXfermode::Create(SkXfermode::kSrc_Mode))->unref();
-
for (int i = 0; i < atlased.count(); ++i) {
const GrCachedLayer* layer = atlased[i].fLayer;
const SkPicture* pict = atlased[i].fPicture;
@@ -211,9 +207,7 @@ void GrLayerHoister::DrawLayersToAtlas(GrContext* context,
// extend beyond the boundaries of the atlased sub-rect
const SkRect bound = SkRect::Make(layer->rect());
atlasCanvas->clipRect(bound);
-
- // Since 'clear' doesn't respect the clip we need to draw a rect
- atlasCanvas->drawRect(bound, clearPaint);
+ atlasCanvas->clear(0);
// '-offset' maps the layer's top/left to the origin.
// Since this layer is atlased, the top/left corner needs
@@ -228,7 +222,7 @@ void GrLayerHoister::DrawLayersToAtlas(GrContext* context,
SkRecordPartialDraw(*pict->fRecord.get(), atlasCanvas,
pict->drawablePicts(), pict->drawableCount(),
- bound, layer->start() + 1, layer->stop(), initialCTM);
+ layer->start() + 1, layer->stop(), initialCTM);
atlasCanvas->restore();
}
@@ -255,7 +249,6 @@ void GrLayerHoister::DrawLayers(GrContext* context, const SkTDArray<GrHoistedLay
// extend beyond the boundaries of the layer
const SkRect bound = SkRect::Make(layer->rect());
layerCanvas->clipRect(bound);
-
layerCanvas->clear(SK_ColorTRANSPARENT);
SkMatrix initialCTM;
@@ -267,7 +260,7 @@ void GrLayerHoister::DrawLayers(GrContext* context, const SkTDArray<GrHoistedLay
SkRecordPartialDraw(*pict->fRecord.get(), layerCanvas,
pict->drawablePicts(), pict->drawableCount(),
- bound, layer->start()+1, layer->stop(), initialCTM);
+ layer->start()+1, layer->stop(), initialCTM);
layerCanvas->flush();
}
« no previous file with comments | « src/core/SkRecords.h ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698