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

Unified Diff: src/core/SkCanvas.cpp

Issue 2309483002: WIP RasterCanvasLayerAllocator experiment 2
Patch Set: vend smart pointers to SkCanvas Created 4 years, 3 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 | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkManagedBitmapDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index e53a104c47fa28406f1d440dbcd670365d877a24..0bea28288394821e099f8bc4b5c61029bd7422f9 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -752,6 +752,17 @@ SkCanvas::SkCanvas(SkBaseDevice* device)
this->init(device, kDefault_InitFlags);
}
+SkCanvas::SkCanvas(SkBaseDevice* device, SkRasterCanvasLayerAllocator* allocator)
+ : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
+ , fProps(device->surfaceProps())
+ , fConservativeRasterClip(false)
+ , fLayerAllocator(allocator)
+{
+ inc_canvas();
+
+ this->init(device, kDefault_InitFlags);
+}
+
SkCanvas::SkCanvas(SkBaseDevice* device, InitFlags flags)
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
, fProps(device->surfaceProps())
@@ -1266,7 +1277,7 @@ void SkCanvas::internalSaveLayer(const SaveLayerRec& rec, SaveLayerStrategy stra
const SkBaseDevice::TileUsage usage = SkBaseDevice::kNever_TileUsage;
const SkBaseDevice::CreateInfo createInfo = SkBaseDevice::CreateInfo(info, usage, geo,
preserveLCDText);
- newDevice.reset(priorDevice->onCreateDevice(createInfo, paint));
+ newDevice.reset(priorDevice->onCreateDevice(createInfo, paint, fLayerAllocator.get()));
if (!newDevice) {
SkErrorInternals::SetError(kInternalError_SkError,
"Unable to create device for layer.");
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkManagedBitmapDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698