OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "skia/ext/platform_canvas.h" |
| 6 |
| 7 #include "base/debug/trace_event.h" |
| 8 |
| 9 namespace skia { |
| 10 |
| 11 PlatformCanvas::PlatformCanvas(int width, int height, bool is_opaque) { |
| 12 TRACE_EVENT2("skia", "PlatformCanvas::PlatformCanvas", |
| 13 "width", width, "height", height); |
| 14 if (!initialize(width, height, is_opaque)) |
| 15 SK_CRASH(); |
| 16 } |
| 17 |
| 18 PlatformCanvas::PlatformCanvas(int width, int height, bool is_opaque, |
| 19 uint8_t* data) { |
| 20 TRACE_EVENT2("skia", "PlatformCanvas::PlatformCanvas", |
| 21 "width", width, "height", height); |
| 22 if (!initialize(width, height, is_opaque, data)) |
| 23 SK_CRASH(); |
| 24 } |
| 25 |
| 26 PlatformCanvas::~PlatformCanvas() { |
| 27 } |
| 28 |
| 29 bool PlatformCanvas::initialize(int width, int height, bool is_opaque, |
| 30 uint8_t* data) { |
| 31 return initializeWithDevice(new SkDevice(SkBitmap::kARGB_8888_Config, |
| 32 width, height, |
| 33 is_opaque)); |
| 34 } |
| 35 |
| 36 } // namespace skia |
OLD | NEW |