| 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 #ifndef SKIA_EXT_VECTOR_CANVAS_H_ | 5 #ifndef SKIA_EXT_VECTOR_CANVAS_H_ |
| 6 #define SKIA_EXT_VECTOR_CANVAS_H_ | 6 #define SKIA_EXT_VECTOR_CANVAS_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "skia/ext/platform_canvas.h" | 9 #include "skia/ext/platform_canvas.h" |
| 10 #include "skia/ext/refptr.h" |
| 10 | 11 |
| 11 class SkDevice; | 12 class SkDevice; |
| 12 | 13 |
| 13 namespace skia { | 14 namespace skia { |
| 14 | 15 |
| 15 // This class is a specialization of the regular PlatformCanvas. It is designed | 16 // This class is a specialization of the regular PlatformCanvas. It is designed |
| 16 // to work with a VectorDevice to manage platform-specific drawing. It allows | 17 // to work with a VectorDevice to manage platform-specific drawing. It allows |
| 17 // using both Skia operations and platform-specific operations. It *doesn't* | 18 // using both Skia operations and platform-specific operations. It *doesn't* |
| 18 // support reading back from the bitmap backstore since it is not used. | 19 // support reading back from the bitmap backstore since it is not used. |
| 19 class SK_API VectorCanvas : public PlatformCanvas { | 20 class SK_API VectorCanvas : public PlatformCanvas { |
| 20 public: | 21 public: |
| 21 // Ownership of |device| is transfered to VectorCanvas. | 22 // Ownership of |device| is transfered to VectorCanvas. |
| 22 explicit VectorCanvas(SkDevice* device); | 23 explicit VectorCanvas(const skia::RefPtr<SkDevice>& device); |
| 23 virtual ~VectorCanvas(); | 24 virtual ~VectorCanvas(); |
| 24 | 25 |
| 25 virtual SkBounder* setBounder(SkBounder* bounder) OVERRIDE; | 26 virtual SkBounder* setBounder(SkBounder* bounder) OVERRIDE; |
| 26 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) OVERRIDE; | 27 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) OVERRIDE; |
| 27 | 28 |
| 28 private: | 29 private: |
| 29 // Returns true if the top device is vector based and not bitmap based. | 30 // Returns true if the top device is vector based and not bitmap based. |
| 30 bool IsTopDeviceVectorial() const; | 31 bool IsTopDeviceVectorial() const; |
| 31 | 32 |
| 32 // Copy & assign are not supported. | 33 // Copy & assign are not supported. |
| 33 VectorCanvas(const VectorCanvas&); | 34 VectorCanvas(const VectorCanvas&); |
| 34 const VectorCanvas& operator=(const VectorCanvas&); | 35 const VectorCanvas& operator=(const VectorCanvas&); |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 } // namespace skia | 38 } // namespace skia |
| 38 | 39 |
| 39 #endif // SKIA_EXT_VECTOR_CANVAS_H_ | 40 #endif // SKIA_EXT_VECTOR_CANVAS_H_ |
| 40 | 41 |
| OLD | NEW |