OLD | NEW |
| (Empty) |
1 // Copyright (c) 2006-2009 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/vector_canvas.h" | |
6 | |
7 #include "skia/ext/bitmap_platform_device.h" | |
8 #include "skia/ext/vector_platform_device.h" | |
9 | |
10 namespace skia { | |
11 | |
12 VectorCanvas::VectorCanvas(HDC dc, int width, int height) { | |
13 bool initialized = initialize(dc, width, height); | |
14 if (!initialized) | |
15 __debugbreak(); | |
16 } | |
17 | |
18 bool VectorCanvas::initialize(HDC context, int width, int height) { | |
19 SkDevice* device = VectorPlatformDeviceFactory::CreateDevice(width, height, | |
20 true, context); | |
21 if (!device) | |
22 return false; | |
23 | |
24 setDevice(device); | |
25 device->unref(); // was created with refcount 1, and setDevice also refs | |
26 return true; | |
27 } | |
28 | |
29 } // namespace skia | |
30 | |
OLD | NEW |