OLD | NEW |
(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 |
OLD | NEW |