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

Unified Diff: third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.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/modules/imagebitmap/ImageBitmapRenderingContext.cpp
diff --git a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
index 266a97d7b529504c7396d04420ec16b4d4edbdb5..e3a7c54952c2a22402efe539f4cd336283503f87 100644
--- a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
+++ b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
@@ -44,7 +44,11 @@ void ImageBitmapRenderingContext::transferFromImageBitmap(
if (!m_image)
return;
- sk_sp<SkImage> skImage = m_image->imageForCurrentFrame();
+ // TODO(ccameron): Determine the correct color behavior here.
+ // ImageBitmapRenderingContext.
+ // https://crbug.com/672306
+ sk_sp<SkImage> skImage =
+ m_image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget());
if (skImage->isTextureBacked()) {
// TODO(junov): crbug.com/585607 Eliminate this readback and use an
// ExternalTextureLayer
@@ -68,7 +72,9 @@ bool ImageBitmapRenderingContext::paint(GraphicsContext& gc, const IntRect& r) {
return true;
// With impl-side painting, it is unsafe to use a gpu-backed SkImage
- ASSERT(!m_image->imageForCurrentFrame()->isTextureBacked());
+ DCHECK(
+ !m_image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget())
+ ->isTextureBacked());
gc.drawImage(m_image.get(), r, nullptr, creationAttributes().alpha()
? SkBlendMode::kSrcOver
: SkBlendMode::kSrc);

Powered by Google App Engine
This is Rietveld 408576698