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

Unified Diff: src/gpu/GrLayerHoister.cpp

Issue 1947593002: Minor refactor of GrLayerHoister (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 8 months 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 | « no previous file | tests/GpuLayerCacheTest.cpp » ('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 1c6e5738baf2645fcb8aee2b5296ca7547d90a58..4a2a7f5b97f35a56cb4388bad156e94e9f535a8d 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -232,7 +232,7 @@ void GrLayerHoister::DrawLayersToAtlas(GrContext* context,
if (atlased.count() > 0) {
// All the atlased layers are rendered into the same GrTexture
SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
- auto surface(SkSurface::MakeRenderTargetDirect(
+ sk_sp<SkSurface> surface(SkSurface::MakeRenderTargetDirect(
atlased[0].fLayer->texture()->asRenderTarget(), &props));
SkCanvas* atlasCanvas = surface->getCanvas();
@@ -301,7 +301,9 @@ void GrLayerHoister::FilterLayer(GrContext* context,
SkImageFilter::Context filterContext(totMat, clipBounds, cache);
// TODO: should the layer hoister store stand alone layers as SkSpecialImages internally?
- const SkIRect subset = SkIRect::MakeWH(layer->texture()->width(), layer->texture()->height());
+ SkASSERT(layer->rect().width() == layer->texture()->width() &&
+ layer->rect().height() == layer->texture()->height());
+ const SkIRect subset = SkIRect::MakeWH(layer->rect().width(), layer->rect().height());
sk_sp<SkSpecialImage> img(SkSpecialImage::MakeFromGpu(subset,
kNeedNewImageUniqueID_SpecialImage,
sk_ref_sp(layer->texture()),
« no previous file with comments | « no previous file | tests/GpuLayerCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698