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

Unified Diff: third_party/WebKit/Source/platform/graphics/Image.cpp

Issue 2559013002: Add ColorBehavior to blink::Image draw methods (Closed)
Patch Set: Rebase Created 4 years 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: third_party/WebKit/Source/platform/graphics/Image.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Image.cpp b/third_party/WebKit/Source/platform/graphics/Image.cpp
index b04a53b2fa22b5d55bdf95964b8b4db1a0fc7630..5e5a23663f39473dc0a82d4a0e44d2fa30ea5874 100644
--- a/third_party/WebKit/Source/platform/graphics/Image.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Image.cpp
@@ -255,7 +255,7 @@ void Image::drawPattern(GraphicsContext& context,
const FloatSize& repeatSpacing) {
TRACE_EVENT0("skia", "Image::drawPattern");
- sk_sp<SkImage> image = imageForCurrentFrame();
+ sk_sp<SkImage> image = imageForCurrentFrame(context.getColorBehavior());
if (!image)
return;
@@ -311,14 +311,19 @@ PassRefPtr<Image> Image::imageForDefaultFrame() {
}
bool Image::isTextureBacked() {
- sk_sp<SkImage> image = imageForCurrentFrame();
+ // TODO(ccameron): It should not be necessary to specify color conversion for
+ // this query.
+ sk_sp<SkImage> image =
+ imageForCurrentFrame(ColorBehavior::transformToGlobalTarget());
return image ? image->isTextureBacked() : false;
}
-bool Image::applyShader(SkPaint& paint, const SkMatrix& localMatrix) {
+bool Image::applyShader(SkPaint& paint,
+ const SkMatrix& localMatrix,
+ const ColorBehavior& colorBehavior) {
// Default shader impl: attempt to build a shader based on the current frame
// SkImage.
- sk_sp<SkImage> image = imageForCurrentFrame();
+ sk_sp<SkImage> image = imageForCurrentFrame(colorBehavior);
if (!image)
return false;

Powered by Google App Engine
This is Rietveld 408576698