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

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

Issue 22900016: x (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 107
108 bool BitmapImage::hasSingleSecurityOrigin() const 108 bool BitmapImage::hasSingleSecurityOrigin() const
109 { 109 {
110 return true; 110 return true;
111 } 111 }
112 112
113 113
114 void BitmapImage::destroyDecodedData() 114 void BitmapImage::destroyDecodedData()
115 { 115 {
116 TRACE_EVENT2("webkit", "destroyDecodedData", "debug", debug(data()), "curren tFrame", (int)m_currentFrame);
116 for (size_t i = 0; i < m_frames.size(); ++i) { 117 for (size_t i = 0; i < m_frames.size(); ++i) {
117 // The underlying frame isn't actually changing (we're just trying to 118 // The underlying frame isn't actually changing (we're just trying to
118 // save the memory for the framebuffer data), so we don't need to clear 119 // save the memory for the framebuffer data), so we don't need to clear
119 // the metadata. 120 // the metadata.
120 m_frames[i].clear(false); 121 m_frames[i].clear(false);
121 } 122 }
122 123
123 destroyMetadataAndNotify(m_source.clearCacheExceptFrame(m_currentFrame)); 124 destroyMetadataAndNotify(m_source.clearCacheExceptFrame(m_currentFrame));
124 } 125 }
125 126
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 if (index >= frameCount()) 365 if (index >= frameCount())
365 return false; 366 return false;
366 367
367 if (index >= m_frames.size() || !m_frames[index].m_frame) 368 if (index >= m_frames.size() || !m_frames[index].m_frame)
368 cacheFrame(index); 369 cacheFrame(index);
369 return true; 370 return true;
370 } 371 }
371 372
372 PassRefPtr<NativeImageSkia> BitmapImage::frameAtIndex(size_t index) 373 PassRefPtr<NativeImageSkia> BitmapImage::frameAtIndex(size_t index)
373 { 374 {
375 TRACE_EVENT2("webkit", "frameAtIndex", "debug", debug(data()), "index", (int )index);
374 if (!ensureFrameIsCached(index)) 376 if (!ensureFrameIsCached(index))
375 return 0; 377 return 0;
376 return m_frames[index].m_frame; 378 return m_frames[index].m_frame;
377 } 379 }
378 380
379 bool BitmapImage::frameIsCompleteAtIndex(size_t index) 381 bool BitmapImage::frameIsCompleteAtIndex(size_t index)
380 { 382 {
381 if (index < m_frames.size() && m_frames[index].m_haveMetadata && m_frames[in dex].m_isComplete) 383 if (index < m_frames.size() && m_frames[index].m_haveMetadata && m_frames[in dex].m_isComplete)
382 return true; 384 return true;
383 return m_source.frameIsCompleteAtIndex(index); 385 return m_source.frameIsCompleteAtIndex(index);
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 } 653 }
652 return m_isSolidColor && !m_currentFrame; 654 return m_isSolidColor && !m_currentFrame;
653 } 655 }
654 656
655 Color BitmapImage::solidColor() const 657 Color BitmapImage::solidColor() const
656 { 658 {
657 return m_solidColor; 659 return m_solidColor;
658 } 660 }
659 661
660 } 662 }
OLDNEW
« no previous file with comments | « Source/core/platform/SharedBuffer.h ('k') | Source/core/platform/image-decoders/png/PNGImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698