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

Side by Side Diff: Source/core/platform/graphics/BitmapImage.cpp

Issue 23464095: WTF::notFound looks too much like a local variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/platform/MIMETypeFromURL.cpp ('k') | Source/core/platform/graphics/ImageSource.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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 void BitmapImage::destroyDecodedData(bool destroyAll) 108 void BitmapImage::destroyDecodedData(bool destroyAll)
109 { 109 {
110 for (size_t i = 0; i < m_frames.size(); ++i) { 110 for (size_t i = 0; i < m_frames.size(); ++i) {
111 // The underlying frame isn't actually changing (we're just trying to 111 // The underlying frame isn't actually changing (we're just trying to
112 // save the memory for the framebuffer data), so we don't need to clear 112 // save the memory for the framebuffer data), so we don't need to clear
113 // the metadata. 113 // the metadata.
114 m_frames[i].clear(false); 114 m_frames[i].clear(false);
115 } 115 }
116 116
117 destroyMetadataAndNotify(m_source.clearCacheExceptFrame(destroyAll ? notFoun d : m_currentFrame)); 117 destroyMetadataAndNotify(m_source.clearCacheExceptFrame(destroyAll ? kNotFou nd : m_currentFrame));
118 } 118 }
119 119
120 void BitmapImage::destroyDecodedDataIfNecessary() 120 void BitmapImage::destroyDecodedDataIfNecessary()
121 { 121 {
122 // Animated images >5MB are considered large enough that we'll only hang on 122 // Animated images >5MB are considered large enough that we'll only hang on
123 // to one frame at a time. 123 // to one frame at a time.
124 static const size_t cLargeAnimationCutoff = 5242880; 124 static const size_t cLargeAnimationCutoff = 5242880;
125 size_t allFrameBytes = 0; 125 size_t allFrameBytes = 0;
126 for (size_t i = 0; i < m_frames.size(); ++i) 126 for (size_t i = 0; i < m_frames.size(); ++i)
127 allFrameBytes += m_frames[i].m_frameBytes; 127 allFrameBytes += m_frames[i].m_frameBytes;
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 } 645 }
646 return m_isSolidColor && !m_currentFrame; 646 return m_isSolidColor && !m_currentFrame;
647 } 647 }
648 648
649 Color BitmapImage::solidColor() const 649 Color BitmapImage::solidColor() const
650 { 650 {
651 return m_solidColor; 651 return m_solidColor;
652 } 652 }
653 653
654 } 654 }
OLDNEW
« no previous file with comments | « Source/core/platform/MIMETypeFromURL.cpp ('k') | Source/core/platform/graphics/ImageSource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698