Index: dm/DMSrcSink.cpp |
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp |
index 6fd46c80ed99a3b299ad139b0b6bfe5192a5e0fa..78782a086629ce6f33477ec8ceeee3a54f841543 100644 |
--- a/dm/DMSrcSink.cpp |
+++ b/dm/DMSrcSink.cpp |
@@ -990,7 +990,7 @@ Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co |
} |
#endif |
- SkAutoTUnref<SkSurface> surface( |
+ auto surface( |
NewGpuSurface(&factory, fContextType, fContextOptions, info, fSampleCount, fUseDIText)); |
if (!surface) { |
return "Could not create a surface."; |
@@ -1309,19 +1309,19 @@ Error ViaTiles::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkStri |
const int xTiles = (size.width() + fW - 1) / fW, |
yTiles = (size.height() + fH - 1) / fH; |
SkMultiPictureDraw mpd(xTiles*yTiles); |
- SkTDArray<SkSurface*> surfaces; |
- surfaces.setReserve(xTiles*yTiles); |
+ SkTArray<sk_sp<SkSurface>> surfaces; |
+// surfaces.setReserve(xTiles*yTiles); |
SkImageInfo info = canvas->imageInfo().makeWH(fW, fH); |
for (int j = 0; j < yTiles; j++) { |
for (int i = 0; i < xTiles; i++) { |
// This lets our ultimate Sink determine the best kind of surface. |
// E.g., if it's a GpuSink, the surfaces and images are textures. |
- SkSurface* s = canvas->newSurface(info); |
+ auto s = canvas->makeSurface(info); |
if (!s) { |
- s = SkSurface::NewRaster(info); // Some canvases can't create surfaces. |
+ s = SkSurface::MakeRaster(info); // Some canvases can't create surfaces. |
} |
- surfaces.push(s); |
+ surfaces.push_back(s); |
SkCanvas* c = s->getCanvas(); |
c->translate(SkIntToScalar(-i * fW), |
SkIntToScalar(-j * fH)); // Line up the canvas with this tile. |
@@ -1335,7 +1335,6 @@ Error ViaTiles::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkStri |
canvas->drawImage(image, SkIntToScalar(i*fW), SkIntToScalar(j*fH)); |
} |
} |
- surfaces.unrefAll(); |
return ""; |
}); |
} |