summaryrefslogtreecommitdiffstats
path: root/skia/ext/vector_canvas.h
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-21 23:03:56 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-21 23:03:56 +0000
commit156f2c0e187c0283f026fd356a4b682d4b4eaaa1 (patch)
tree209d254abb43d9ff2cb9a904dd16eed00a85bfb4 /skia/ext/vector_canvas.h
parentbd2e63eed24e8c097be6ea3fb46aa354c638e88e (diff)
downloadchromium_src-156f2c0e187c0283f026fd356a4b682d4b4eaaa1.zip
chromium_src-156f2c0e187c0283f026fd356a4b682d4b4eaaa1.tar.gz
chromium_src-156f2c0e187c0283f026fd356a4b682d4b4eaaa1.tar.bz2
Move skia extensions from the port to skia/ext for Windows only. Fixed the
include guards of the moved files, but nothing else. Review URL: http://codereview.chromium.org/11568 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5861 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/vector_canvas.h')
-rw-r--r--skia/ext/vector_canvas.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/skia/ext/vector_canvas.h b/skia/ext/vector_canvas.h
new file mode 100644
index 0000000..8538366
--- /dev/null
+++ b/skia/ext/vector_canvas.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_GFX_VECTOR_CANVAS_H_
+#define BASE_GFX_VECTOR_CANVAS_H_
+
+#include "base/gfx/platform_canvas_win.h"
+#include "base/gfx/vector_device.h"
+
+namespace gfx {
+
+// This class is a specialization of the regular PlatformCanvas. It is designed
+// to work with a VectorDevice to manage platform-specific drawing. It allows
+// using both Skia operations and platform-specific operations. It *doesn't*
+// support reading back from the bitmap backstore since it is not used.
+class VectorCanvas : public PlatformCanvasWin {
+ public:
+ VectorCanvas();
+ VectorCanvas(HDC dc, int width, int height);
+ virtual ~VectorCanvas();
+
+ // For two-part init, call if you use the no-argument constructor above
+ bool initialize(HDC context, int width, int height);
+
+ virtual SkBounder* setBounder(SkBounder*);
+ virtual SkDevice* createDevice(SkBitmap::Config config,
+ int width, int height,
+ bool is_opaque, bool isForLayer);
+ virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter);
+
+ private:
+ // |is_opaque| is unused. |shared_section| is in fact the HDC used for output.
+ virtual SkDevice* createPlatformDevice(int width, int height, bool is_opaque,
+ HANDLE shared_section);
+
+ // Returns true if the top device is vector based and not bitmap based.
+ bool IsTopDeviceVectorial() const;
+
+ DISALLOW_COPY_AND_ASSIGN(VectorCanvas);
+};
+
+} // namespace gfx
+
+#endif // BASE_GFX_VECTOR_CANVAS_H_
+