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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 748853002: Add support for hoisting layers in pictures drawn with a matrix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up Created 6 years, 1 month 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/gpu/GrRecordReplaceDraw.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index ca79d0a2d19c18a79c7982d1b9dbcc50d968860b..029d49df2617662cf3e22cb49d19e9e87e5d6e86 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -23,6 +23,7 @@
#include "SkGrTexturePixelRef.h"
+#include "SkCanvasPriv.h"
#include "SkDeviceImageFilterProxy.h"
#include "SkDrawProcs.h"
#include "SkGlyphCache.h"
@@ -1788,8 +1789,8 @@ SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps
bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture* mainPicture,
const SkMatrix* matrix, const SkPaint* paint) {
- // todo: should handle these natively
- if (matrix || paint) {
+ // todo: should handle this natively
+ if (paint) {
return false;
}
@@ -1805,9 +1806,14 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
return true;
}
+ SkAutoCanvasMatrixPaint acmp(mainCanvas, matrix, paint, mainPicture->cullRect());
+
+ const SkMatrix initialMatrix = mainCanvas->getTotalMatrix();
+
SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled;
GrLayerHoister::FindLayersToAtlas(fContext, mainPicture,
+ initialMatrix,
clipBounds,
&atlasedNeedRendering, &atlasedRecycled,
fRenderTarget->numSamples());
@@ -1817,6 +1823,7 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
SkTDArray<GrHoistedLayer> needRendering, recycled;
GrLayerHoister::FindLayersToHoist(fContext, mainPicture,
+ initialMatrix,
clipBounds,
&needRendering, &recycled,
fRenderTarget->numSamples());
@@ -1829,8 +1836,6 @@ bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
GrLayerHoister::ConvertLayersToReplacements(recycled, &replacements);
// Render the entire picture using new layers
- const SkMatrix initialMatrix = mainCanvas->getTotalMatrix();
-
GrRecordReplaceDraw(mainPicture, mainCanvas, &replacements, initialMatrix, NULL);
GrLayerHoister::UnlockLayers(fContext, needRendering);
« no previous file with comments | « src/gpu/GrRecordReplaceDraw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698