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

Unified Diff: src/core/SkRasterCanvasLayerAllocator.cpp

Issue 1763143002: WIP RasterCanvasLayerAllocator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: test and some further work Created 4 years, 7 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
Index: src/core/SkRasterCanvasLayerAllocator.cpp
diff --git a/src/core/SkRasterCanvasLayerAllocator.cpp b/src/core/SkRasterCanvasLayerAllocator.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5e76000163ed9516dd26f68a9d970f169415794c
--- /dev/null
+++ b/src/core/SkRasterCanvasLayerAllocator.cpp
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkRasterCanvasLayerAllocator.h"
+
+#include "SkCanvas.h"
+#include "SkPaint.h"
+#include "SkRefCnt.h"
+
+SkRasterCanvasLayerAllocator::SkRasterCanvasLayerAllocator() { }
+
+SkRasterCanvasLayerAllocator::~SkRasterCanvasLayerAllocator() { }
+
+SkCanvas* SkRasterCanvasLayerAllocator::CreateCanvas(const SkImageInfo& info) {
+ SkBitmap bmp;
+ size_t rowBytes;
+ void* layer = this->allocateLayer(info, &rowBytes);
+ if (layer) {
+ bmp.installPixels(info, layer, rowBytes);
+ }
+ return new SkCanvas(bmp, sk_ref_sp(this));
+}
+
+

Powered by Google App Engine
This is Rietveld 408576698