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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp

Issue 2216073002: Color: Add ColorCorrectRendering flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decoder_profile
Patch Set: Rebase Created 4 years, 4 months 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/image-decoders/ImageFrame.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
index 180328041303ac23bdf9b5d472a183b5203bac5c..6a4db8fa2d711b56af64eac34f940d4fd870781b 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
@@ -24,6 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "platform/image-decoders/ImageFrame.h"
+
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/image-decoders/ImageDecoder.h"
namespace blink {
@@ -98,11 +101,12 @@ bool ImageFrame::setSizeAndColorProfile(int newWidth, int newHeight, const ICCPr
// setSizeAndColorProfile() should only be called once, it leaks memory otherwise.
ASSERT(!width() && !height());
- // TODO(ccameron): Populate the color space parameter of the SkImageInfo
- // with newIccProfile, under a runtime flag.
+ sk_sp<SkColorSpace> colorSpace;
+ if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled() && !newIccProfile.isEmpty())
+ colorSpace = SkColorSpace::NewICC(newIccProfile.data(), newIccProfile.size());
m_bitmap.setInfo(SkImageInfo::MakeN32(newWidth, newHeight,
- m_premultiplyAlpha ? kPremul_SkAlphaType : kUnpremul_SkAlphaType));
+ m_premultiplyAlpha ? kPremul_SkAlphaType : kUnpremul_SkAlphaType, colorSpace));
if (!m_bitmap.tryAllocPixels(m_allocator, 0))
return false;
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/ImageFrame.h ('k') | third_party/WebKit/Source/web/WebRuntimeFeatures.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698