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

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

Issue 2530443004: Add target color profile to BitmapImage::draw (Closed)
Patch Set: Created 4 years, 1 month 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/GraphicsContext.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
index 973d0ea9e622b966f90fee79a3b92feb7c1a4a06..4749d95251d9c0db50ffb94f55006556688c5a79 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
@@ -34,6 +34,7 @@
#include "platform/graphics/ImageBuffer.h"
#include "platform/graphics/Path.h"
#include "platform/graphics/paint/PaintController.h"
+#include "platform/image-decoders/ImageDecoder.h"
#include "platform/tracing/TraceEvent.h"
#include "platform/weborigin/KURL.h"
#include "skia/ext/platform_canvas.h"
@@ -806,8 +807,9 @@ void GraphicsContext::drawImage(
imagePaint.setColor(SK_ColorBLACK);
imagePaint.setFilterQuality(computeFilterQuality(image, dest, src));
imagePaint.setAntiAlias(shouldAntialias());
- image->draw(m_canvas, imagePaint, dest, src, shouldRespectImageOrientation,
- Image::ClampImageToSourceRect);
+ image->drawInColorSpace(
+ m_canvas, imagePaint, dest, src, shouldRespectImageOrientation,
+ Image::ClampImageToSourceRect, ImageDecoder::globalTargetColorSpace());
m_paintController.setImagePainted();
}
@@ -854,8 +856,9 @@ void GraphicsContext::drawImageRRect(
SkAutoCanvasRestore autoRestore(m_canvas, true);
m_canvas->clipRRect(dest, SkRegion::kIntersect_Op,
imagePaint.isAntiAlias());
- image->draw(m_canvas, imagePaint, dest.rect(), srcRect, respectOrientation,
- Image::ClampImageToSourceRect);
+ image->drawInColorSpace(m_canvas, imagePaint, dest.rect(), srcRect,
+ respectOrientation, Image::ClampImageToSourceRect,
+ ImageDecoder::globalTargetColorSpace());
}
m_paintController.setImagePainted();

Powered by Google App Engine
This is Rietveld 408576698