| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 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 | 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 | 6 |
| 7 #include "skia/ext/vector_platform_device.h" | |
| 8 | |
| 9 namespace skia { | 7 namespace skia { |
| 10 | 8 |
| 11 VectorCanvas::VectorCanvas(PlatformDevice* device) | 9 VectorCanvas::VectorCanvas() |
| 12 : PlatformCanvas(device->getDeviceFactory()) { | 10 : PlatformCanvas(SkNEW(VectorPlatformDeviceFactory)) { |
| 13 setDevice(device)->unref(); // Created with refcount 1, and setDevice refs. | 11 } |
| 12 |
| 13 VectorCanvas::VectorCanvas(SkDeviceFactory* factory) : PlatformCanvas(factory) { |
| 14 } | 14 } |
| 15 | 15 |
| 16 VectorCanvas::~VectorCanvas() { | 16 VectorCanvas::~VectorCanvas() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 SkBounder* VectorCanvas::setBounder(SkBounder* bounder) { | 19 SkBounder* VectorCanvas::setBounder(SkBounder* bounder) { |
| 20 if (!IsTopDeviceVectorial()) | 20 if (!IsTopDeviceVectorial()) |
| 21 return PlatformCanvas::setBounder(bounder); | 21 return PlatformCanvas::setBounder(bounder); |
| 22 | 22 |
| 23 // This function isn't used in the code. Verify this assumption. | 23 // This function isn't used in the code. Verify this assumption. |
| 24 SkASSERT(false); | 24 SkASSERT(false); |
| 25 return NULL; | 25 return NULL; |
| 26 } | 26 } |
| 27 | 27 |
| 28 SkDrawFilter* VectorCanvas::setDrawFilter(SkDrawFilter* filter) { | 28 SkDrawFilter* VectorCanvas::setDrawFilter(SkDrawFilter* filter) { |
| 29 // This function isn't used in the code. Verify this assumption. | 29 // This function isn't used in the code. Verify this assumption. |
| 30 SkASSERT(false); | 30 SkASSERT(false); |
| 31 return NULL; | 31 return NULL; |
| 32 } | 32 } |
| 33 | 33 |
| 34 bool VectorCanvas::IsTopDeviceVectorial() const { | 34 bool VectorCanvas::IsTopDeviceVectorial() const { |
| 35 return getTopPlatformDevice().IsVectorial(); | 35 return getTopPlatformDevice().IsVectorial(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace skia | 38 } // namespace skia |
| 39 | 39 |
| OLD | NEW |