Chromium Code Reviews| Index: skia/ext/alpha_proxy_canvas.h |
| diff --git a/skia/ext/alpha_proxy_canvas.h b/skia/ext/alpha_proxy_canvas.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d0d8dcc210713a10e3731abafe2effe7671d8334 |
| --- /dev/null |
| +++ b/skia/ext/alpha_proxy_canvas.h |
| @@ -0,0 +1,90 @@ |
| +// Copyright (c) 2013 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_ALPHA_PROXY_CANVAS_H_ |
| +#define SKIA_EXT_ALPHA_PROXY_CANVAS_H_ |
| + |
| +#include "base/compiler_specific.h" |
| +#include "third_party/skia/include/utils/SkProxyCanvas.h" |
| + |
| +namespace skia { |
| + |
| +class SK_API AlphaProxyCanvas : public SkProxyCanvas { |
|
jamesr
2013/08/26 18:09:08
why is this in skia/ext/? If it's logically part
|
| + public: |
| + AlphaProxyCanvas(SkCanvas* target, float opacity, bool allow_filter); |
| + virtual ~AlphaProxyCanvas(); |
| + |
| + virtual int saveLayer(const SkRect* bounds, |
| + const SkPaint* paint, |
| + SkCanvas::SaveFlags flags) OVERRIDE; |
| + virtual void drawPaint(const SkPaint& paint) OVERRIDE; |
| + virtual void drawPoints(SkCanvas::PointMode mode, |
| + size_t count, |
| + const SkPoint pts[], |
| + const SkPaint& paint) OVERRIDE; |
| + virtual void drawRect(const SkRect& rect, const SkPaint& paint) OVERRIDE; |
| + virtual void drawOval(const SkRect& oval, const SkPaint& paint) OVERRIDE; |
| + virtual void drawRRect(const SkRRect& rrect, const SkPaint& paint) OVERRIDE; |
| + virtual void drawPath(const SkPath& path, const SkPaint& paint) OVERRIDE; |
| + virtual void drawBitmap(const SkBitmap& bitmap, |
| + SkScalar left, |
| + SkScalar top, |
| + const SkPaint* paint) OVERRIDE; |
| + virtual void drawBitmapRectToRect(const SkBitmap& bitmap, |
| + const SkRect* src, |
| + const SkRect& dst, |
| + const SkPaint* paint) OVERRIDE; |
| + virtual void drawBitmapMatrix(const SkBitmap& bitmap, |
| + const SkMatrix& m, |
| + const SkPaint* paint) OVERRIDE; |
| + virtual void drawBitmapNine(const SkBitmap& bitmap, |
| + const SkIRect& center, |
| + const SkRect& dst, |
| + const SkPaint* paint) OVERRIDE; |
| + virtual void drawSprite(const SkBitmap& bitmap, |
| + int left, |
| + int top, |
| + const SkPaint* paint) OVERRIDE; |
| + virtual void drawText(const void* text, |
| + size_t byteLength, |
| + SkScalar x, |
| + SkScalar y, |
| + const SkPaint& paint) OVERRIDE; |
| + virtual void drawPosText(const void* text, |
| + size_t byteLength, |
| + const SkPoint pos[], |
| + const SkPaint& paint) OVERRIDE; |
| + virtual void drawPosTextH(const void* text, |
| + size_t byteLength, |
| + const SkScalar xpos[], |
| + SkScalar constY, |
| + const SkPaint& paint) OVERRIDE; |
| + virtual void drawTextOnPath(const void* text, |
| + size_t byteLength, |
| + const SkPath& path, |
| + const SkMatrix* matrix, |
| + const SkPaint& paint) OVERRIDE; |
| + virtual void drawVertices(SkCanvas::VertexMode vmode, |
| + int vertexCount, |
| + const SkPoint vertices[], |
| + const SkPoint texs[], |
| + const SkColor colors[], |
| + SkXfermode* xmode, |
| + const uint16_t indices[], |
| + int indexCount, |
| + const SkPaint& paint) OVERRIDE; |
| + |
| + private: |
| + typedef SkProxyCanvas INHERITED; |
| + |
| + SkPaint AlphaPaint(const SkPaint* paint) const; |
| + |
| + float opacity_; |
| + bool allow_filter_; |
| +}; |
| + |
| +} // namespace skia |
| + |
| +#endif // SKIA_EXT_ALPHA_PROXY_CANVAS_H_ |
| + |