| 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_PLATFORM_DEVICE_EMF_WIN_H_ | 5 #ifndef SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_ |
| 6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_ | 6 #define SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "skia/ext/platform_device.h" | 10 #include "skia/ext/platform_device.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 SK_API static SkBaseDevice* CreateDevice(int width, int height, bool isOpaque, | 24 SK_API static SkBaseDevice* CreateDevice(int width, int height, bool isOpaque, |
| 25 HANDLE shared_section); | 25 HANDLE shared_section); |
| 26 | 26 |
| 27 // Factory function. The DC is kept as the output context. | 27 // Factory function. The DC is kept as the output context. |
| 28 static SkBaseDevice* create(HDC dc, int width, int height); | 28 static SkBaseDevice* create(HDC dc, int width, int height); |
| 29 | 29 |
| 30 VectorPlatformDeviceEmf(HDC dc, const SkBitmap& bitmap); | 30 VectorPlatformDeviceEmf(HDC dc, const SkBitmap& bitmap); |
| 31 virtual ~VectorPlatformDeviceEmf(); | 31 virtual ~VectorPlatformDeviceEmf(); |
| 32 | 32 |
| 33 // PlatformDevice methods | 33 // PlatformDevice methods |
| 34 virtual PlatformSurface BeginPlatformPaint() OVERRIDE; | 34 virtual PlatformSurface BeginPlatformPaint() override; |
| 35 virtual void DrawToNativeContext(HDC dc, int x, int y, | 35 virtual void DrawToNativeContext(HDC dc, int x, int y, |
| 36 const RECT* src_rect) OVERRIDE; | 36 const RECT* src_rect) override; |
| 37 // SkBaseDevice methods. | 37 // SkBaseDevice methods. |
| 38 virtual void drawPaint(const SkDraw& draw, const SkPaint& paint) OVERRIDE; | 38 virtual void drawPaint(const SkDraw& draw, const SkPaint& paint) override; |
| 39 virtual void drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, | 39 virtual void drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, |
| 40 size_t count, const SkPoint[], | 40 size_t count, const SkPoint[], |
| 41 const SkPaint& paint) OVERRIDE; | 41 const SkPaint& paint) override; |
| 42 virtual void drawRect(const SkDraw& draw, const SkRect& r, | 42 virtual void drawRect(const SkDraw& draw, const SkRect& r, |
| 43 const SkPaint& paint) OVERRIDE; | 43 const SkPaint& paint) override; |
| 44 virtual void drawRRect(const SkDraw&, const SkRRect& rr, | 44 virtual void drawRRect(const SkDraw&, const SkRRect& rr, |
| 45 const SkPaint& paint) OVERRIDE; | 45 const SkPaint& paint) override; |
| 46 virtual void drawPath(const SkDraw& draw, const SkPath& path, | 46 virtual void drawPath(const SkDraw& draw, const SkPath& path, |
| 47 const SkPaint& paint, | 47 const SkPaint& paint, |
| 48 const SkMatrix* prePathMatrix = NULL, | 48 const SkMatrix* prePathMatrix = NULL, |
| 49 bool pathIsMutable = false) OVERRIDE; | 49 bool pathIsMutable = false) override; |
| 50 virtual void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, | 50 virtual void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, |
| 51 const SkRect* src, const SkRect& dst, | 51 const SkRect* src, const SkRect& dst, |
| 52 const SkPaint& paint, | 52 const SkPaint& paint, |
| 53 SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE; | 53 SkCanvas::DrawBitmapRectFlags flags) override; |
| 54 virtual void drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, | 54 virtual void drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, |
| 55 const SkMatrix& matrix, | 55 const SkMatrix& matrix, |
| 56 const SkPaint& paint) OVERRIDE; | 56 const SkPaint& paint) override; |
| 57 virtual void drawSprite(const SkDraw& draw, const SkBitmap& bitmap, | 57 virtual void drawSprite(const SkDraw& draw, const SkBitmap& bitmap, |
| 58 int x, int y, const SkPaint& paint) OVERRIDE; | 58 int x, int y, const SkPaint& paint) override; |
| 59 virtual void drawText(const SkDraw& draw, const void* text, size_t len, | 59 virtual void drawText(const SkDraw& draw, const void* text, size_t len, |
| 60 SkScalar x, SkScalar y, const SkPaint& paint) OVERRIDE; | 60 SkScalar x, SkScalar y, const SkPaint& paint) override; |
| 61 virtual void drawPosText(const SkDraw& draw, const void* text, size_t len, | 61 virtual void drawPosText(const SkDraw& draw, const void* text, size_t len, |
| 62 const SkScalar pos[], int scalarsPerPos, | 62 const SkScalar pos[], int scalarsPerPos, |
| 63 const SkPoint& offset, const SkPaint& paint) OVERRIDE
; | 63 const SkPoint& offset, const SkPaint& paint) override
; |
| 64 virtual void drawTextOnPath(const SkDraw& draw, const void* text, size_t len, | 64 virtual void drawTextOnPath(const SkDraw& draw, const void* text, size_t len, |
| 65 const SkPath& path, const SkMatrix* matrix, | 65 const SkPath& path, const SkMatrix* matrix, |
| 66 const SkPaint& paint) OVERRIDE; | 66 const SkPaint& paint) override; |
| 67 virtual void drawVertices(const SkDraw& draw, SkCanvas::VertexMode, | 67 virtual void drawVertices(const SkDraw& draw, SkCanvas::VertexMode, |
| 68 int vertexCount, | 68 int vertexCount, |
| 69 const SkPoint verts[], const SkPoint texs[], | 69 const SkPoint verts[], const SkPoint texs[], |
| 70 const SkColor colors[], SkXfermode* xmode, | 70 const SkColor colors[], SkXfermode* xmode, |
| 71 const uint16_t indices[], int indexCount, | 71 const uint16_t indices[], int indexCount, |
| 72 const SkPaint& paint) OVERRIDE; | 72 const SkPaint& paint) override; |
| 73 virtual void drawDevice(const SkDraw& draw, SkBaseDevice*, int x, int y, | 73 virtual void drawDevice(const SkDraw& draw, SkBaseDevice*, int x, int y, |
| 74 const SkPaint&) OVERRIDE; | 74 const SkPaint&) override; |
| 75 | 75 |
| 76 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region, | 76 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region, |
| 77 const SkClipStack&) OVERRIDE; | 77 const SkClipStack&) override; |
| 78 | 78 |
| 79 void LoadClipRegion(); | 79 void LoadClipRegion(); |
| 80 | 80 |
| 81 protected: | 81 protected: |
| 82 virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, | 82 virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, |
| 83 Usage usage) OVERRIDE; | 83 Usage usage) override; |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 // Applies the SkPaint's painting properties in the current GDI context, if | 86 // Applies the SkPaint's painting properties in the current GDI context, if |
| 87 // possible. If GDI can't support all paint's properties, returns false. It | 87 // possible. If GDI can't support all paint's properties, returns false. It |
| 88 // doesn't execute the "commands" in SkPaint. | 88 // doesn't execute the "commands" in SkPaint. |
| 89 bool ApplyPaint(const SkPaint& paint); | 89 bool ApplyPaint(const SkPaint& paint); |
| 90 | 90 |
| 91 // Selects a new object in the device context. It can be a pen, a brush, a | 91 // Selects a new object in the device context. It can be a pen, a brush, a |
| 92 // clipping region, a bitmap or a font. Returns the old selected object. | 92 // clipping region, a bitmap or a font. Returns the old selected object. |
| 93 HGDIOBJ SelectObject(HGDIOBJ object); | 93 HGDIOBJ SelectObject(HGDIOBJ object); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 typedef void (*SkiaEnsureTypefaceCharactersAccessible) | 135 typedef void (*SkiaEnsureTypefaceCharactersAccessible) |
| 136 (const LOGFONT& font, const wchar_t* text, unsigned int text_length); | 136 (const LOGFONT& font, const wchar_t* text, unsigned int text_length); |
| 137 | 137 |
| 138 SK_API void SetSkiaEnsureTypefaceCharactersAccessible( | 138 SK_API void SetSkiaEnsureTypefaceCharactersAccessible( |
| 139 SkiaEnsureTypefaceCharactersAccessible func); | 139 SkiaEnsureTypefaceCharactersAccessible func); |
| 140 | 140 |
| 141 } // namespace skia | 141 } // namespace skia |
| 142 | 142 |
| 143 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_ | 143 #endif // SKIA_EXT_VECTOR_PLATFORM_DEVICE_EMF_WIN_H_ |
| OLD | NEW |