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

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

Issue 1488133002: Add usage metrics for display and image color profiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed histograms to use suffixes Created 5 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 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // this frame is a blank frame, so it can again be decoded alone. 237 // this frame is a blank frame, so it can again be decoded alone.
238 // Otherwise, the previous frame contributes to this frame. 238 // Otherwise, the previous frame contributes to this frame.
239 return (prevBuffer->originalFrameRect().contains(IntRect(IntPoint(), siz e())) 239 return (prevBuffer->originalFrameRect().contains(IntRect(IntPoint(), siz e()))
240 || (prevBuffer->requiredPreviousFrameIndex() == kNotFound)) ? kNotFo und : prevFrame; 240 || (prevBuffer->requiredPreviousFrameIndex() == kNotFound)) ? kNotFo und : prevFrame;
241 default: 241 default:
242 ASSERT_NOT_REACHED(); 242 ASSERT_NOT_REACHED();
243 return kNotFound; 243 return kNotFound;
244 } 244 }
245 } 245 }
246 246
247 #if USE(QCMSLIB)
248 ImageDecoder::OutputDeviceProfile::OutputDeviceProfile() : m_outputDeviceProfile (0)
249 {
250 ColorProfileStatus status = ColorProfileSuccess;
251
252 ColorProfile profile = screenColorProfile();
253 if (!profile.isEmpty()) {
254 if (ImageDecoder::isICCv4(profile.data(), profile.size())) {
255 status = ColorProfileIsV4;
Noel Gordon 2015/12/23 15:28:48 We don't seem to actually read / use the profile i
Justin Novosad 2015/12/23 15:58:10 The prupose is to track the prevalence of ICC v4 p
256 } else {
257 m_outputDeviceProfile = qcms_profile_from_memory(profile.data(), pro file.size());
258 if (!m_outputDeviceProfile) {
259 status = ColorProfileFailedDecode;
Noel Gordon 2015/12/23 15:28:48 ColorProfileFailedDecode -> ColorProfileInvalidCon
260 } else {
261 if (qcms_profile_is_bogus(m_outputDeviceProfile)) {
262 status = ColorProfileIsBogus;
Noel Gordon 2015/12/23 15:28:48 ColorProfileIsBogus -> ColorProfileInvalidProfile
263 qcms_profile_release(m_outputDeviceProfile);
264 m_outputDeviceProfile = 0;
265 }
266 }
267 }
268 } else {
269 status = ColorProfileNone;
Noel Gordon 2015/12/23 15:28:47 ColorProfileNone -> ColorProfileEmpty the profile
270 }
271
272 Platform::current()->histogramEnumeration("ColorManagement.ColorProfileStatu s.Display", status, ColorProfileStatus::ValueCount);
273
274 if (!m_outputDeviceProfile)
275 m_outputDeviceProfile = qcms_profile_sRGB();
276 if (m_outputDeviceProfile)
277 qcms_profile_precache_output_transform(m_outputDeviceProfile);
278 }
279 #endif
280
247 ImagePlanes::ImagePlanes() 281 ImagePlanes::ImagePlanes()
248 { 282 {
249 for (int i = 0; i < 3; ++i) { 283 for (int i = 0; i < 3; ++i) {
250 m_planes[i] = 0; 284 m_planes[i] = 0;
251 m_rowBytes[i] = 0; 285 m_rowBytes[i] = 0;
252 } 286 }
253 } 287 }
254 288
255 ImagePlanes::ImagePlanes(void* planes[3], size_t rowBytes[3]) 289 ImagePlanes::ImagePlanes(void* planes[3], size_t rowBytes[3])
256 { 290 {
257 for (int i = 0; i < 3; ++i) { 291 for (int i = 0; i < 3; ++i) {
258 m_planes[i] = planes[i]; 292 m_planes[i] = planes[i];
259 m_rowBytes[i] = rowBytes[i]; 293 m_rowBytes[i] = rowBytes[i];
260 } 294 }
261 } 295 }
262 296
263 void* ImagePlanes::plane(int i) 297 void* ImagePlanes::plane(int i)
264 { 298 {
265 ASSERT((i >= 0) && i < 3); 299 ASSERT((i >= 0) && i < 3);
266 return m_planes[i]; 300 return m_planes[i];
267 } 301 }
268 302
269 size_t ImagePlanes::rowBytes(int i) const 303 size_t ImagePlanes::rowBytes(int i) const
270 { 304 {
271 ASSERT((i >= 0) && i < 3); 305 ASSERT((i >= 0) && i < 3);
272 return m_rowBytes[i]; 306 return m_rowBytes[i];
273 } 307 }
274 308
275 } // namespace blink 309 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698