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