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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/BitmapImage.cpp

Issue 1413593012: Record UMA stats for Blink decoded image orientation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Different approach Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/ImageOrientation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 m_frames.grow(numFrames); 160 m_frames.grow(numFrames);
161 161
162 int deltaBytes = totalFrameBytes(); 162 int deltaBytes = totalFrameBytes();
163 163
164 164
165 // We are caching frame snapshots. This is OK even for partially decoded fr ames, 165 // We are caching frame snapshots. This is OK even for partially decoded fr ames,
166 // as they are cleared by dataChanged() when new data arrives. 166 // as they are cleared by dataChanged() when new data arrives.
167 m_frames[index].m_frame = m_source.createFrameAtIndex(index); 167 m_frames[index].m_frame = m_source.createFrameAtIndex(index);
168 168
169 m_frames[index].m_orientation = m_source.orientationAtIndex(index); 169 m_frames[index].m_orientation = m_source.orientationAtIndex(index);
170 Platform::current()->histogramEnumeration("Blink.DecodedImageOrientation", m _frames[index].m_orientation.orientation(), OriginLeftBottom + 1);
Noel Gordon 2015/11/10 01:14:56 The actual image orientation is not known until is
170 m_frames[index].m_haveMetadata = true; 171 m_frames[index].m_haveMetadata = true;
171 m_frames[index].m_isComplete = m_source.frameIsCompleteAtIndex(index); 172 m_frames[index].m_isComplete = m_source.frameIsCompleteAtIndex(index);
172 if (repetitionCount(false) != cAnimationNone) 173 if (repetitionCount(false) != cAnimationNone)
173 m_frames[index].m_duration = m_source.frameDurationAtIndex(index); 174 m_frames[index].m_duration = m_source.frameDurationAtIndex(index);
174 m_frames[index].m_hasAlpha = m_source.frameHasAlphaAtIndex(index); 175 m_frames[index].m_hasAlpha = m_source.frameHasAlphaAtIndex(index);
175 m_frames[index].m_frameBytes = m_source.frameBytesAtIndex(index); 176 m_frames[index].m_frameBytes = m_source.frameBytesAtIndex(index);
176 177
177 const IntSize frameSize(index ? m_source.frameSizeAtIndex(index) : m_size); 178 const IntSize frameSize(index ? m_source.frameSizeAtIndex(index) : m_size);
178 if (frameSize != m_size) 179 if (frameSize != m_size)
179 m_hasUniformFrameSize = false; 180 m_hasUniformFrameSize = false;
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 destroyDecodedDataIfNecessary(); 664 destroyDecodedDataIfNecessary();
664 665
665 // We need to draw this frame if we advanced to it while not skipping, or if 666 // We need to draw this frame if we advanced to it while not skipping, or if
666 // while trying to skip frames we hit the last frame and thus had to stop. 667 // while trying to skip frames we hit the last frame and thus had to stop.
667 if (skippingFrames != advancedAnimation) 668 if (skippingFrames != advancedAnimation)
668 imageObserver()->animationAdvanced(this); 669 imageObserver()->animationAdvanced(this);
669 return advancedAnimation; 670 return advancedAnimation;
670 } 671 }
671 672
672 } // namespace blink 673 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/ImageOrientation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698