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

Unified Diff: src/core/SkBitmapProcState.cpp

Issue 1010343002: add kGray_8_SkColorType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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/SkBitmap.cpp ('k') | src/core/SkBitmapProcState_procs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcState.cpp
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index 42d9c1003e04f703c68f7bb0499d1072ec28ca2a..69c2ea19be30a6e7a97b5a1a6d5481e1917300da 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -431,6 +431,10 @@ bool SkBitmapProcState::chooseScanlineProcs(bool trivialMatrix, bool clampClamp,
index |= 32;
fPaintPMColor = SkPreMultiplyColor(paint.getColor());
break;
+ case kGray_8_SkColorType:
+ index |= 40;
+ fPaintPMColor = SkPreMultiplyColor(paint.getColor());
+ break;
default:
// TODO(dominikg): Should we ever get here? SkASSERT(false) instead?
return false;
@@ -473,7 +477,7 @@ bool SkBitmapProcState::chooseScanlineProcs(bool trivialMatrix, bool clampClamp,
S4444_alpha_D32_filter_DXDY,
S4444_opaque_D32_filter_DX,
S4444_alpha_D32_filter_DX,
-
+
// A8 treats alpha/opaque the same (equally efficient)
SA8_alpha_D32_nofilter_DXDY,
SA8_alpha_D32_nofilter_DXDY,
@@ -482,7 +486,17 @@ bool SkBitmapProcState::chooseScanlineProcs(bool trivialMatrix, bool clampClamp,
SA8_alpha_D32_filter_DXDY,
SA8_alpha_D32_filter_DXDY,
SA8_alpha_D32_filter_DX,
- SA8_alpha_D32_filter_DX
+ SA8_alpha_D32_filter_DX,
+
+ // todo: possibly specialize on opaqueness
+ SG8_alpha_D32_nofilter_DXDY,
+ SG8_alpha_D32_nofilter_DXDY,
+ SG8_alpha_D32_nofilter_DX,
+ SG8_alpha_D32_nofilter_DX,
+ SG8_alpha_D32_filter_DXDY,
+ SG8_alpha_D32_filter_DXDY,
+ SG8_alpha_D32_filter_DX,
+ SG8_alpha_D32_filter_DX
};
static const SampleProc16 gSkBitmapProcStateSample16[] = {
@@ -504,6 +518,8 @@ bool SkBitmapProcState::chooseScanlineProcs(bool trivialMatrix, bool clampClamp,
// Don't support 4444 -> 565
NULL, NULL, NULL, NULL,
// Don't support A8 -> 565
+ NULL, NULL, NULL, NULL,
+ // Don't support G8 -> 565 (but we could)
NULL, NULL, NULL, NULL
};
#endif
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkBitmapProcState_procs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698