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 { |
| 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, |
| 38 DrawBitmapRectFlags flags) OVERRIDE; |
| 39 virtual void drawBitmapMatrix(const SkBitmap& bitmap, |
| 40 const SkMatrix& m, |
| 41 const SkPaint* paint) OVERRIDE; |
| 42 virtual void drawBitmapNine(const SkBitmap& bitmap, |
| 43 const SkIRect& center, |
| 44 const SkRect& dst, |
| 45 const SkPaint* paint) OVERRIDE; |
| 46 virtual void drawSprite(const SkBitmap& bitmap, |
| 47 int left, |
| 48 int top, |
| 49 const SkPaint* paint) OVERRIDE; |
| 50 virtual void drawText(const void* text, |
| 51 size_t byteLength, |
| 52 SkScalar x, |
| 53 SkScalar y, |
| 54 const SkPaint& paint) OVERRIDE; |
| 55 virtual void drawPosText(const void* text, |
| 56 size_t byteLength, |
| 57 const SkPoint pos[], |
| 58 const SkPaint& paint) OVERRIDE; |
| 59 virtual void drawPosTextH(const void* text, |
| 60 size_t byteLength, |
| 61 const SkScalar xpos[], |
| 62 SkScalar constY, |
| 63 const SkPaint& paint) OVERRIDE; |
| 64 virtual void drawTextOnPath(const void* text, |
| 65 size_t byteLength, |
| 66 const SkPath& path, |
| 67 const SkMatrix* matrix, |
| 68 const SkPaint& paint) OVERRIDE; |
| 69 virtual void drawVertices(SkCanvas::VertexMode vmode, |
| 70 int vertexCount, |
| 71 const SkPoint vertices[], |
| 72 const SkPoint texs[], |
| 73 const SkColor colors[], |
| 74 SkXfermode* xmode, |
| 75 const uint16_t indices[], |
| 76 int indexCount, |
| 77 const SkPaint& paint) OVERRIDE; |
| 78 |
| 79 private: |
| 80 typedef SkProxyCanvas INHERITED; |
| 81 |
| 82 SkPaint AlphaPaint(const SkPaint* paint) const; |
| 83 |
| 84 float opacity_; |
| 85 bool allow_filter_; |
| 86 }; |
| 87 |
| 88 } // namespace skia |
| 89 |
| 90 #endif // SKIA_EXT_ALPHA_PROXY_CANVAS_H_ |
| 91 |
OLD | NEW |