OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 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_ALPHA_PROXY_CANVAS_H_ | |
6 #define SKIA_EXT_ALPHA_PROXY_CANVAS_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "third_party/skia/include/utils/SkProxyCanvas.h" | |
10 | |
11 namespace skia { | |
12 | |
13 class SK_API AlphaProxyCanvas : public SkProxyCanvas { | |
jamesr
2013/08/26 18:09:08
why is this in skia/ext/? If it's logically part
| |
14 public: | |
15 AlphaProxyCanvas(SkCanvas* target, float opacity, bool allow_filter); | |
16 virtual ~AlphaProxyCanvas(); | |
17 | |
18 virtual int saveLayer(const SkRect* bounds, | |
19 const SkPaint* paint, | |
20 SkCanvas::SaveFlags flags) OVERRIDE; | |
21 virtual void drawPaint(const SkPaint& paint) OVERRIDE; | |
22 virtual void drawPoints(SkCanvas::PointMode mode, | |
23 size_t count, | |
24 const SkPoint pts[], | |
25 const SkPaint& paint) OVERRIDE; | |
26 virtual void drawRect(const SkRect& rect, const SkPaint& paint) OVERRIDE; | |
27 virtual void drawOval(const SkRect& oval, const SkPaint& paint) OVERRIDE; | |
28 virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) OVERRIDE; | |
29 virtual void drawPath(const SkPath& path, const SkPaint& paint) OVERRIDE; | |
30 virtual void drawBitmap(const SkBitmap& bitmap, | |
31 SkScalar left, | |
32 SkScalar top, | |
33 const SkPaint* paint) OVERRIDE; | |
34 virtual void drawBitmapRectToRect(const SkBitmap& bitmap, | |
35 const SkRect* src, | |
36 const SkRect& dst, | |
37 const SkPaint* paint) OVERRIDE; | |
38 virtual void drawBitmapMatrix(const SkBitmap& bitmap, | |
39 const SkMatrix& m, | |
40 const SkPaint* paint) OVERRIDE; | |
41 virtual void drawBitmapNine(const SkBitmap& bitmap, | |
42 const SkIRect& center, | |
43 const SkRect& dst, | |
44 const SkPaint* paint) OVERRIDE; | |
45 virtual void drawSprite(const SkBitmap& bitmap, | |
46 int left, | |
47 int top, | |
48 const SkPaint* paint) OVERRIDE; | |
49 virtual void drawText(const void* text, | |
50 size_t byteLength, | |
51 SkScalar x, | |
52 SkScalar y, | |
53 const SkPaint& paint) OVERRIDE; | |
54 virtual void drawPosText(const void* text, | |
55 size_t byteLength, | |
56 const SkPoint pos[], | |
57 const SkPaint& paint) OVERRIDE; | |
58 virtual void drawPosTextH(const void* text, | |
59 size_t byteLength, | |
60 const SkScalar xpos[], | |
61 SkScalar constY, | |
62 const SkPaint& paint) OVERRIDE; | |
63 virtual void drawTextOnPath(const void* text, | |
64 size_t byteLength, | |
65 const SkPath& path, | |
66 const SkMatrix* matrix, | |
67 const SkPaint& paint) OVERRIDE; | |
68 virtual void drawVertices(SkCanvas::VertexMode vmode, | |
69 int vertexCount, | |
70 const SkPoint vertices[], | |
71 const SkPoint texs[], | |
72 const SkColor colors[], | |
73 SkXfermode* xmode, | |
74 const uint16_t indices[], | |
75 int indexCount, | |
76 const SkPaint& paint) OVERRIDE; | |
77 | |
78 private: | |
79 typedef SkProxyCanvas INHERITED; | |
80 | |
81 SkPaint AlphaPaint(const SkPaint* paint) const; | |
82 | |
83 float opacity_; | |
84 bool allow_filter_; | |
85 }; | |
86 | |
87 } // namespace skia | |
88 | |
89 #endif // SKIA_EXT_ALPHA_PROXY_CANVAS_H_ | |
90 | |
OLD | NEW |