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

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 6558ebd306ada5416811644b555a875b83923a76..254fb5cf6440c4bb4e3dc1d797b3b5823b8ca129 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