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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp

Issue 1796293003: Image decode color: Push color profile from browser to renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove prototype Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 inline bool matchesCURSignature(char* contents) 75 inline bool matchesCURSignature(char* contents)
76 { 76 {
77 return !memcmp(contents, "\x00\x00\x02\x00", 4); 77 return !memcmp(contents, "\x00\x00\x02\x00", 4);
78 } 78 }
79 79
80 inline bool matchesBMPSignature(char* contents) 80 inline bool matchesBMPSignature(char* contents)
81 { 81 {
82 return !memcmp(contents, "BM", 2); 82 return !memcmp(contents, "BM", 2);
83 } 83 }
84 84
85 void ImageDecoder::setOutputDeviceColorProfile(const ColorProfile& colorProfile)
86 {
87 #if USE(QCMSLIB)
88 qcmsOutputDeviceProfile(&colorProfile);
89 #endif
90 }
91
85 PassOwnPtr<ImageDecoder> ImageDecoder::create(const SharedBuffer& data, AlphaOpt ion alphaOption, GammaAndColorProfileOption colorOptions) 92 PassOwnPtr<ImageDecoder> ImageDecoder::create(const SharedBuffer& data, AlphaOpt ion alphaOption, GammaAndColorProfileOption colorOptions)
86 { 93 {
87 const size_t longestSignatureLength = sizeof("RIFF????WEBPVP") - 1; 94 const size_t longestSignatureLength = sizeof("RIFF????WEBPVP") - 1;
88 ASSERT(longestSignatureLength == 14); 95 ASSERT(longestSignatureLength == 14);
89 96
90 size_t maxDecodedBytes = Platform::current() ? Platform::current()->maxDecod edImageBytes() : noDecodedImageByteLimit; 97 size_t maxDecodedBytes = Platform::current() ? Platform::current()->maxDecod edImageBytes() : noDecodedImageByteLimit;
91 98
92 char contents[longestSignatureLength]; 99 char contents[longestSignatureLength];
93 if (copyFromSharedBuffer(contents, longestSignatureLength, data, 0) < longes tSignatureLength) 100 if (copyFromSharedBuffer(contents, longestSignatureLength, data, 0) < longes tSignatureLength)
94 return nullptr; 101 return nullptr;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 return m_planes[i]; 272 return m_planes[i];
266 } 273 }
267 274
268 size_t ImagePlanes::rowBytes(int i) const 275 size_t ImagePlanes::rowBytes(int i) const
269 { 276 {
270 ASSERT((i >= 0) && i < 3); 277 ASSERT((i >= 0) && i < 3);
271 return m_rowBytes[i]; 278 return m_rowBytes[i];
272 } 279 }
273 280
274 } // namespace blink 281 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698