Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: skia/ext/alpha_proxy_canvas.h

Issue 22867046: Optimize alpha software PictureDrawQuads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add DCHECK for xfermode Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..ce9b3aeed8b2adff9e436ce0ea051932adcf48d2
--- /dev/null
+++ b/skia/ext/alpha_proxy_canvas.h
@@ -0,0 +1,91 @@
+// 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 {
+ 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,
+ DrawBitmapRectFlags flags) 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_
+

Powered by Google App Engine
This is Rietveld 408576698