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

Side by Side Diff: Source/platform/graphics/ImageSource.cpp

Issue 1008243003: Nuke NativeImageSkia -- new version. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Convert BitmapImage::createFrameAtIndex() to Skia-style Created 5 years, 9 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 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk> 3 * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk>
4 * Copyright (C) 2008, Google Inc. All rights reserved. 4 * Copyright (C) 2008, Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 { 100 {
101 return m_decoder ? m_decoder->repetitionCount() : cAnimationNone; 101 return m_decoder ? m_decoder->repetitionCount() : cAnimationNone;
102 } 102 }
103 103
104 size_t ImageSource::frameCount() const 104 size_t ImageSource::frameCount() const
105 { 105 {
106 int count = m_decoder ? m_decoder->frameCount() : 0; 106 int count = m_decoder ? m_decoder->frameCount() : 0;
107 return count; 107 return count;
108 } 108 }
109 109
110 PassRefPtr<NativeImageSkia> ImageSource::createFrameAtIndex(size_t index) 110 bool ImageSource::createFrameAtIndex(size_t index, SkBitmap* bitmap)
111 { 111 {
112 if (!m_decoder) 112 if (!m_decoder)
113 return nullptr; 113 return false;
114 return m_decoder->createFrameAtIndex(index); 114 *bitmap = m_decoder->createFrameAtIndex(index);
115 return true;
115 } 116 }
116 117
117 float ImageSource::frameDurationAtIndex(size_t index) const 118 float ImageSource::frameDurationAtIndex(size_t index) const
118 { 119 {
119 if (!m_decoder) 120 if (!m_decoder)
120 return 0; 121 return 0;
121 122
122 // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. 123 // Many annoying ads specify a 0 duration to make an image flash as quickly as possible.
123 // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify 124 // We follow Firefox's behavior and use a duration of 100 ms for any frames that specify
124 // a duration of <= 10 ms. See <rdar://problem/7689300> and <http://webkit.o rg/b/36082> 125 // a duration of <= 10 ms. See <rdar://problem/7689300> and <http://webkit.o rg/b/36082>
(...skipping 18 matching lines...) Expand all
143 { 144 {
144 return m_decoder && m_decoder->frameIsCompleteAtIndex(index); 145 return m_decoder && m_decoder->frameIsCompleteAtIndex(index);
145 } 146 }
146 147
147 unsigned ImageSource::frameBytesAtIndex(size_t index) const 148 unsigned ImageSource::frameBytesAtIndex(size_t index) const
148 { 149 {
149 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; 150 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0;
150 } 151 }
151 152
152 } // namespace blink 153 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698