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

Unified Diff: src/core/SkBitmapDevice.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 | « include/core/SkRasterCanvasLayerAllocator.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapDevice.cpp
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 4f8074d3a672ea0df255a09cc540b5c726e552fa..35d16b3c0530f29c37a09999aef6ae128df7c33d 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -11,11 +11,13 @@
#include "SkImageFilter.h"
#include "SkImageFilterCache.h"
#include "SkMallocPixelRef.h"
+#include "SkManagedBitmapDevice.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkPixelRef.h"
#include "SkPixmap.h"
+#include "SkRasterCanvasLayerAllocator.h"
#include "SkRasterClip.h"
#include "SkShader.h"
#include "SkSpecialImage.h"
@@ -134,8 +136,12 @@ void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) {
this->privateResize(fBitmap.info().width(), fBitmap.info().height());
}
-SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint*) {
+SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint*,
+ SkRasterCanvasLayerAllocator* allocator) {
const SkSurfaceProps surfaceProps(this->surfaceProps().flags(), cinfo.fPixelGeometry);
+ if (allocator) {
+ return allocator->makeDevice(cinfo.fInfo, surfaceProps);
+ }
return SkBitmapDevice::Create(cinfo.fInfo, surfaceProps);
}
« no previous file with comments | « include/core/SkRasterCanvasLayerAllocator.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698