OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "skia/ext/vector_canvas.h" | 5 #include "skia/ext/vector_canvas.h" |
6 #include "third_party/skia/include/core/SkDevice.h" | 6 #include "third_party/skia/include/core/SkDevice.h" |
7 | 7 |
8 namespace skia { | 8 namespace skia { |
9 | 9 |
10 VectorCanvas::VectorCanvas(SkDevice* device) | 10 VectorCanvas::VectorCanvas(SkDevice* device) |
11 : PlatformCanvas(device->getDeviceFactory()) { | 11 : PlatformCanvas() { |
alokp
2011/06/28 16:19:46
no need to explicitly call the default constructor
| |
12 setDevice(device)->unref(); // Created with refcount 1, and setDevice refs. | 12 setDevice(device)->unref(); // Created with refcount 1, and setDevice refs. |
13 } | 13 } |
14 | 14 |
15 VectorCanvas::~VectorCanvas() { | 15 VectorCanvas::~VectorCanvas() { |
16 } | 16 } |
17 | 17 |
18 SkBounder* VectorCanvas::setBounder(SkBounder* bounder) { | 18 SkBounder* VectorCanvas::setBounder(SkBounder* bounder) { |
19 if (!IsTopDeviceVectorial()) | 19 if (!IsTopDeviceVectorial()) |
20 return PlatformCanvas::setBounder(bounder); | 20 return PlatformCanvas::setBounder(bounder); |
21 | 21 |
22 // This function isn't used in the code. Verify this assumption. | 22 // This function isn't used in the code. Verify this assumption. |
23 SkASSERT(false); | 23 SkASSERT(false); |
24 return NULL; | 24 return NULL; |
25 } | 25 } |
26 | 26 |
27 SkDrawFilter* VectorCanvas::setDrawFilter(SkDrawFilter* filter) { | 27 SkDrawFilter* VectorCanvas::setDrawFilter(SkDrawFilter* filter) { |
28 // This function isn't used in the code. Verify this assumption. | 28 // This function isn't used in the code. Verify this assumption. |
29 SkASSERT(false); | 29 SkASSERT(false); |
30 return NULL; | 30 return NULL; |
31 } | 31 } |
32 | 32 |
33 bool VectorCanvas::IsTopDeviceVectorial() const { | 33 bool VectorCanvas::IsTopDeviceVectorial() const { |
34 SkDevice* device = GetTopDevice(*this); | 34 SkDevice* device = GetTopDevice(*this); |
35 return device->getDeviceCapabilities() & SkDevice::kVector_Capability; | 35 return device->getDeviceCapabilities() & SkDevice::kVector_Capability; |
36 } | 36 } |
37 | 37 |
38 } // namespace skia | 38 } // namespace skia |
39 | 39 |
OLD | NEW |