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

Unified Diff: src/core/SkDrawProcs.h

Issue 14637007: Detect color masks, and divert to draw-sprite instead of maskblitters (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDrawProcs.h
===================================================================
--- src/core/SkDrawProcs.h (revision 8931)
+++ src/core/SkDrawProcs.h (working copy)
@@ -8,6 +8,7 @@
#ifndef SkDrawProcs_DEFINED
#define SkDrawProcs_DEFINED
+#include "SkBlitter.h"
#include "SkDraw.h"
class SkAAClip;
@@ -20,6 +21,7 @@
const SkAAClip* fAAClip;
SkBlitter* fBlitter;
SkGlyphCache* fCache;
+ const SkPaint* fPaint;
SkIRect fClipBounds;
/** Half the sampling frequency of the rasterized glyph in x. */
SkFixed fHalfSampleX;
@@ -35,7 +37,22 @@
*/
typedef void (*Proc)(const SkDraw1Glyph&, SkFixed x, SkFixed y, const SkGlyph&);
- Proc init(const SkDraw* draw, SkBlitter* blitter, SkGlyphCache* cache);
+ Proc init(const SkDraw* draw, SkBlitter* blitter, SkGlyphCache* cache,
+ const SkPaint&);
+
+ // call this instead of fBlitter->blitMask() since this wrapper will handle
+ // the case when the mask is ARGB32_Format
+ //
+ void blitMask(const SkMask& mask, const SkIRect& clip) const {
+ if (SkMask::kARGB32_Format == mask.fFormat) {
+ this->blitMaskAsSprite(mask);
+ } else {
+ fBlitter->blitMask(mask, clip);
+ }
+ }
+
+ // mask must be kARGB32_Format
+ void blitMaskAsSprite(const SkMask& mask) const;
};
struct SkDrawProcs {
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698