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

Unified Diff: third_party/WebKit/Source/platform/graphics/BitmapImage.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/BitmapImage.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
index d10753d5ce285af95ca13d082412a9fa4087a214..d5570f313d73f0aef13749006ce174d5900b82c0 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
@@ -264,10 +264,11 @@ void BitmapImage::draw(
const FloatRect& dstRect,
const FloatRect& srcRect,
RespectImageOrientationEnum shouldRespectImageOrientation,
- ImageClampingMode clampMode) {
+ ImageClampingMode clampMode,
+ const ColorBehavior& colorBehavior) {
TRACE_EVENT0("skia", "BitmapImage::draw");
- sk_sp<SkImage> image = imageForCurrentFrame();
+ sk_sp<SkImage> image = imageForCurrentFrame(colorBehavior);
if (!image)
return; // It's too early and we don't have an image yet.
@@ -370,11 +371,8 @@ float BitmapImage::frameDurationAtIndex(size_t index) const {
return m_source.frameDurationAtIndex(index);
}
-sk_sp<SkImage> BitmapImage::imageForCurrentFrame() {
- // TODO(ccameron): Allow the caller of imageForCurrentFrame to specify the
- // the desired ColorBehavior.
- // https://crbug.com/667420
- const ColorBehavior& colorBehavior = m_cachedFrameColorBehavior;
+sk_sp<SkImage> BitmapImage::imageForCurrentFrame(
+ const ColorBehavior& colorBehavior) {
return frameAtIndex(currentFrame(), colorBehavior);
}

Powered by Google App Engine
This is Rietveld 408576698