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

Side by Side 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 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 "SkCanvas.h"
11 #include "SkPaint.h"
12 #include "SkRefCnt.h"
13
14 SkRasterCanvasLayerAllocator::SkRasterCanvasLayerAllocator() { }
15
16 SkRasterCanvasLayerAllocator::~SkRasterCanvasLayerAllocator() { }
17
18 SkCanvas* SkRasterCanvasLayerAllocator::CreateCanvas(const SkImageInfo& info) {
19 SkBitmap bmp;
20 size_t rowBytes;
21 void* layer = this->allocateLayer(info, &rowBytes);
22 if (layer) {
23 bmp.installPixels(info, layer, rowBytes);
24 }
25 return new SkCanvas(bmp, sk_ref_sp(this));
26 }
27
28
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698