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

Side by Side Diff: src/core/SkRasterCanvasLayerAllocator.cpp

Issue 2309483002: WIP RasterCanvasLayerAllocator experiment 2
Patch Set: support initial data? 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkRasterCanvasLayerAllocator.h"
9
10 #include "SkBitmapDevice.h"
11
12 SkRasterCanvasLayerAllocator::SkRasterCanvasLayerAllocator() { }
13
14 SkRasterCanvasLayerAllocator::~SkRasterCanvasLayerAllocator() { }
15
16 SkCanvas* SkRasterCanvasLayerAllocator::CreateCanvas(const SkImageInfo& info,
17 const SkSurfaceProps& props ,
18 void* initialData) {
19 SkAutoTUnref<SkBaseDevice> newDevice;
20 SkBitmap bitmap;
21 size_t rowBytes;
22 void* pixels = this->allocateLayer(info, &rowBytes, initialData);
23 if (!pixels) {
24 return nullptr;
25 }
26 bitmap.installPixels(info, pixels, rowBytes);
27 SkBitmapDevice* device = new SkBitmapDevice(bitmap, props);
reed1 2016/09/16 13:15:00 why do we allocate a device here?
28 return new SkCanvas(bitmap, this);
29 }
30
31
OLDNEW
« src/core/SkCanvas.cpp ('K') | « src/core/SkCanvas.cpp ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698