summaryrefslogtreecommitdiffstats
path: root/skia/ext/platform_device_win.h
diff options
context:
space:
mode:
authortwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 15:02:23 +0000
committertwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-25 15:02:23 +0000
commita602d87983b0775ec00f7f0c073189723a02306d (patch)
tree5b98cd87f4e4f32006c7f7d01775cdd7c1461c25 /skia/ext/platform_device_win.h
parent567ffeaa47098fd761d082c0f7b5d4b958260537 (diff)
downloadchromium_src-a602d87983b0775ec00f7f0c073189723a02306d.zip
chromium_src-a602d87983b0775ec00f7f0c073189723a02306d.tar.gz
chromium_src-a602d87983b0775ec00f7f0c073189723a02306d.tar.bz2
CL removing inheritance of SkDevice from PlatformDevice.
PlatformDevice is now a base interface, which is implemented by the various flavours of BitmapPlatformDevice, and VectorPlatformDevice. The BitmapPlatformDevice and VectorPlatformDevice classes now inherit directly from SkDevice, or SkPDFDevice, as appropriate. PlatformDevice helper functions access the PlatformDevice interface attached to a SkDevice via meta-data on the SkDevice. BUG=none TEST=none Review URL: http://codereview.chromium.org/7633040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98230 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/platform_device_win.h')
-rw-r--r--skia/ext/platform_device_win.h90
1 files changed, 0 insertions, 90 deletions
diff --git a/skia/ext/platform_device_win.h b/skia/ext/platform_device_win.h
deleted file mode 100644
index f21ca1f..0000000
--- a/skia/ext/platform_device_win.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2011 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 SKIA_EXT_PLATFORM_DEVICE_WIN_H_
-#define SKIA_EXT_PLATFORM_DEVICE_WIN_H_
-#pragma once
-
-#include <windows.h>
-
-#include <vector>
-
-#include "third_party/skia/include/core/SkDevice.h"
-
-class SkMatrix;
-class SkPath;
-class SkRegion;
-
-namespace skia {
-
-// Initializes the default settings and colors in a device context.
-SK_API void InitializeDC(HDC context);
-
-// A device is basically a wrapper around SkBitmap that provides a surface for
-// SkCanvas to draw into. Our device provides a surface Windows can also write
-// to. It also provides functionality to play well with GDI drawing functions.
-// This class is abstract and must be subclassed. It provides the basic
-// interface to implement it either with or without a bitmap backend.
-class SK_API PlatformDevice : public SkDevice {
- public:
- typedef HDC PlatformSurface;
-
- // The DC that corresponds to the bitmap, used for GDI operations drawing
- // into the bitmap. This is possibly heavyweight, so it should be existant
- // only during one pass of rendering.
- virtual PlatformSurface BeginPlatformPaint() = 0;
-
- // Finish a previous call to beginPlatformPaint.
- virtual void EndPlatformPaint();
-
- // Draws to the given screen DC, if the bitmap DC doesn't exist, this will
- // temporarily create it. However, if you have created the bitmap DC, it will
- // be more efficient if you don't free it until after this call so it doesn't
- // have to be created twice. If src_rect is null, then the entirety of the
- // source device will be copied.
- virtual void DrawToNativeContext(HDC dc, int x, int y,
- const RECT* src_rect) = 0;
-
- // Sets the opacity of each pixel in the specified region to be opaque.
- virtual void MakeOpaque(int x, int y, int width, int height) { }
-
- // Returns if GDI is allowed to render text to this device.
- virtual bool IsNativeFontRenderingAllowed() { return true; }
-
- // True if AlphaBlend() was called during a
- // BeginPlatformPaint()/EndPlatformPaint() pair.
- // Used by the printing subclasses. See |VectorPlatformDeviceEmf|.
- virtual bool AlphaBlendUsed() const { return false; }
-
- // Loads a SkPath into the GDI context. The path can there after be used for
- // clipping or as a stroke. Returns false if the path failed to be loaded.
- static bool LoadPathToDC(HDC context, const SkPath& path);
-
- // Loads a SkRegion into the GDI context.
- static void LoadClippingRegionToDC(HDC context, const SkRegion& region,
- const SkMatrix& transformation);
-
- protected:
- // Arrays must be inside structures.
- struct CubicPoints {
- SkPoint p[4];
- };
- typedef std::vector<CubicPoints> CubicPath;
- typedef std::vector<CubicPath> CubicPaths;
-
- // Forwards |bitmap| to SkDevice's constructor.
- PlatformDevice(const SkBitmap& bitmap);
-
- // Loads the specified Skia transform into the device context, excluding
- // perspective (which GDI doesn't support).
- static void LoadTransformToDC(HDC dc, const SkMatrix& matrix);
-
- // Transforms SkPath's paths into a series of cubic path.
- static bool SkPathToCubicPaths(CubicPaths* paths, const SkPath& skpath);
-};
-
-} // namespace skia
-
-#endif // SKIA_EXT_PLATFORM_DEVICE_WIN_H_
-