license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame^] | 1 | // Copyright (c) 2006-2008 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. |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 4 | |
| 5 | #ifndef BASE_GFX_VECTOR_CANVAS_H__ |
| 6 | #define BASE_GFX_VECTOR_CANVAS_H__ |
| 7 | |
awalker@google.com | bce88e1 | 2008-08-15 02:47:00 +0900 | [diff] [blame] | 8 | #include "base/gfx/platform_canvas_win.h" |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 9 | #include "base/gfx/vector_device.h" |
| 10 | |
| 11 | namespace gfx { |
| 12 | |
| 13 | // This class is a specialization of the regular PlatformCanvas. It is designed |
| 14 | // to work with a VectorDevice to manage platform-specific drawing. It allows |
| 15 | // using both Skia operations and platform-specific operations. It *doesn't* |
| 16 | // support reading back from the bitmap backstore since it is not used. |
awalker@google.com | bce88e1 | 2008-08-15 02:47:00 +0900 | [diff] [blame] | 17 | class VectorCanvas : public PlatformCanvasWin { |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 18 | public: |
| 19 | VectorCanvas(); |
| 20 | VectorCanvas(HDC dc, int width, int height); |
| 21 | virtual ~VectorCanvas(); |
| 22 | |
| 23 | // For two-part init, call if you use the no-argument constructor above |
| 24 | void initialize(HDC context, int width, int height); |
| 25 | |
| 26 | virtual SkBounder* setBounder(SkBounder*); |
| 27 | virtual SkDevice* createDevice(SkBitmap::Config config, |
| 28 | int width, int height, |
| 29 | bool is_opaque, bool isForLayer); |
| 30 | virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter); |
| 31 | |
| 32 | private: |
| 33 | // |is_opaque| is unused. |shared_section| is in fact the HDC used for output. |
| 34 | virtual SkDevice* createPlatformDevice(int width, int height, bool is_opaque, |
| 35 | HANDLE shared_section); |
| 36 | |
| 37 | // Returns true if the top device is vector based and not bitmap based. |
| 38 | bool IsTopDeviceVectorial() const; |
| 39 | |
| 40 | DISALLOW_EVIL_CONSTRUCTORS(VectorCanvas); |
| 41 | }; |
| 42 | |
| 43 | } // namespace gfx |
| 44 | |
| 45 | #endif // BASE_GFX_VECTOR_CANVAS_H__ |
license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame^] | 46 | |