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

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

Issue 2177933002: Use UMA to track characteristics of dst color spaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix include Created 4 years, 5 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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 * 18 *
19 */ 19 */
20 20
21 #include "platform/image-decoders/ImageDecoder.h" 21 #include "platform/image-decoders/ImageDecoder.h"
22 22
23 #include "platform/PlatformInstrumentation.h" 23 #include "platform/PlatformInstrumentation.h"
24 #include "platform/graphics/BitmapImageMetrics.h"
24 #include "platform/image-decoders/bmp/BMPImageDecoder.h" 25 #include "platform/image-decoders/bmp/BMPImageDecoder.h"
25 #include "platform/image-decoders/gif/GIFImageDecoder.h" 26 #include "platform/image-decoders/gif/GIFImageDecoder.h"
26 #include "platform/image-decoders/ico/ICOImageDecoder.h" 27 #include "platform/image-decoders/ico/ICOImageDecoder.h"
27 #include "platform/image-decoders/jpeg/JPEGImageDecoder.h" 28 #include "platform/image-decoders/jpeg/JPEGImageDecoder.h"
28 #include "platform/image-decoders/png/PNGImageDecoder.h" 29 #include "platform/image-decoders/png/PNGImageDecoder.h"
29 #include "platform/image-decoders/webp/WEBPImageDecoder.h" 30 #include "platform/image-decoders/webp/WEBPImageDecoder.h"
30 #include "wtf/PtrUtil.h" 31 #include "wtf/PtrUtil.h"
31 #include <memory> 32 #include <memory>
32 33
33 namespace blink { 34 namespace blink {
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 if (profile.isEmpty()) 309 if (profile.isEmpty())
309 return; 310 return;
310 311
311 // Take a lock around initializing and accessing the global device color pro file. 312 // Take a lock around initializing and accessing the global device color pro file.
312 SpinLock::Guard guard(gTargetColorProfileLock); 313 SpinLock::Guard guard(gTargetColorProfileLock);
313 314
314 // Layout tests expect that only the first call will take effect. 315 // Layout tests expect that only the first call will take effect.
315 if (gTargetColorProfile) 316 if (gTargetColorProfile)
316 return; 317 return;
317 318
319 {
320 sk_sp<SkColorSpace> colorSpace = SkColorSpace::NewICC(profile.data(), pr ofile.size());
321 BitmapImageMetrics::countGamma(colorSpace.get());
322 }
323
318 // FIXME: Add optional ICCv4 support and support for multiple monitors. 324 // FIXME: Add optional ICCv4 support and support for multiple monitors.
319 gTargetColorProfile = qcms_profile_from_memory(profile.data(), profile.size( )); 325 gTargetColorProfile = qcms_profile_from_memory(profile.data(), profile.size( ));
320 if (!gTargetColorProfile) 326 if (!gTargetColorProfile)
321 return; 327 return;
322 328
323 if (qcms_profile_is_bogus(gTargetColorProfile)) { 329 if (qcms_profile_is_bogus(gTargetColorProfile)) {
324 qcms_profile_release(gTargetColorProfile); 330 qcms_profile_release(gTargetColorProfile);
325 gTargetColorProfile = nullptr; 331 gTargetColorProfile = nullptr;
326 return; 332 return;
327 } 333 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 389 }
384 390
385 bool ImageDecoder::hasColorProfile() const 391 bool ImageDecoder::hasColorProfile() const
386 { 392 {
387 return false; 393 return false;
388 } 394 }
389 395
390 #endif // USE(QCMSLIB) 396 #endif // USE(QCMSLIB)
391 397
392 } // namespace blink 398 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/BitmapImageMetrics.cpp ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698