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

Unified Diff: src/core/SkBlitter.cpp

Issue 50673005: Revert "Revert "speed up A8 by creating a new entry-point in SkDraw that blits the path's coverage … (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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/SkBlitter.h ('k') | src/core/SkBlitter_A8.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitter.cpp
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index f4e1a37c80b5177cda0acc7975efbc7ec23ebd4e..f46db357d47d87505fafe279e4b1dfcd798725f0 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -850,14 +850,16 @@ static XferInterp interpret_xfermode(const SkPaint& paint, SkXfermode* xfer,
SkBlitter* SkBlitter::Choose(const SkBitmap& device,
const SkMatrix& matrix,
const SkPaint& origPaint,
- void* storage, size_t storageSize) {
+ void* storage, size_t storageSize,
+ bool drawCoverage) {
SkASSERT(storageSize == 0 || storage != NULL);
SkBlitter* blitter = NULL;
// which check, in case we're being called by a client with a dummy device
// (e.g. they have a bounder that always aborts the draw)
- if (SkBitmap::kNo_Config == device.config()) {
+ if (SkBitmap::kNo_Config == device.config() ||
+ (drawCoverage && (SkBitmap::kA8_Config != device.config()))) {
SK_PLACEMENT_NEW(blitter, SkNullBlitter, storage, storageSize);
return blitter;
}
@@ -940,6 +942,7 @@ SkBlitter* SkBlitter::Choose(const SkBitmap& device,
return blitter;
}
+
switch (device.config()) {
case SkBitmap::kA1_Config:
SK_PLACEMENT_NEW_ARGS(blitter, SkA1_Blitter,
@@ -947,7 +950,12 @@ SkBlitter* SkBlitter::Choose(const SkBitmap& device,
break;
case SkBitmap::kA8_Config:
- if (shader) {
+ if (drawCoverage) {
+ SkASSERT(NULL == shader);
+ SkASSERT(NULL == paint->getXfermode());
+ SK_PLACEMENT_NEW_ARGS(blitter, SkA8_Coverage_Blitter,
+ storage, storageSize, (device, *paint));
+ } else if (shader) {
SK_PLACEMENT_NEW_ARGS(blitter, SkA8_Shader_Blitter,
storage, storageSize, (device, *paint));
} else {
« no previous file with comments | « src/core/SkBlitter.h ('k') | src/core/SkBlitter_A8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698