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

Unified Diff: src/core/SkBlitter_Sprite.cpp

Issue 2086583002: update callers to not use SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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: src/core/SkBlitter_Sprite.cpp
diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp
index 90e38f498ac8fba42e2e561ff30000a2c1b1b836..237f316b560ac6282b5d3088c74f3c206bde1402 100644
--- a/src/core/SkBlitter_Sprite.cpp
+++ b/src/core/SkBlitter_Sprite.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkColorSpacePriv.h"
#include "SkOpts.h"
#include "SkSmallAllocator.h"
#include "SkSpriteBlitter.h"
@@ -59,7 +60,7 @@ public:
if (dst.colorType() != src.colorType()) {
return false;
}
- if (dst.info().profileType() != src.info().profileType()) {
+ if (SkColorSpacePriv::EQ(dst.info().colorSpace(), src.info().colorSpace())) {
Brian Osman 2016/06/20 20:09:19 Should this be !EQ ?
reed1 2016/06/20 21:05:52 Done.
return false;
}
if (paint.getMaskFilter() || paint.getColorFilter() || paint.getImageFilter()) {
@@ -81,8 +82,7 @@ public:
// At this point memcpy can't be used. The following check for using SrcOver.
- if (dst.colorType() != kN32_SkColorType
- || dst.info().profileType() != kSRGB_SkColorProfileType) {
+ if (dst.colorType() != kN32_SkColorType || nullptr == dst.info().colorSpace()) {
Brian Osman 2016/06/20 20:09:19 What exactly was this checking for before? I don't
reed1 2016/06/20 21:05:52 Not sure :) Seems like this class wants to be SRGB
return false;
}
@@ -109,7 +109,7 @@ public:
void blitRect(int x, int y, int width, int height) override {
SkASSERT(fDst.colorType() == fSource.colorType());
- SkASSERT(fDst.info().profileType() == fSource.info().profileType());
+ SkASSERT(SkColorSpacePriv::EQ(fDst.info().colorSpace(), fSource.info().colorSpace()));
SkASSERT(width > 0 && height > 0);
if (fUseMemcpy) {
@@ -175,7 +175,7 @@ SkBlitter* SkBlitter::ChooseSprite(const SkPixmap& dst, const SkPaint& paint,
blitter = SkSpriteBlitter::ChooseD16(source, paint, allocator);
break;
case kN32_SkColorType:
- if (dst.info().isSRGB()) {
+ if (dst.info().gammaCloseToSRGB()) {
blitter = SkSpriteBlitter::ChooseS32(source, paint, allocator);
} else {
blitter = SkSpriteBlitter::ChooseL32(source, paint, allocator);

Powered by Google App Engine
This is Rietveld 408576698