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