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

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

Issue 1001703003: Take NativeImageSkia out behind the woodshed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Switch to skia-style API (return bool instead of SkBitmap) 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
« no previous file with comments | « Source/platform/graphics/ImageSource.h ('k') | Source/platform/graphics/StaticBitmapImage.cpp » ('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 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 return m_decoder->createFrameAtIndex(index, bitmap);
115 } 115 }
116 116
117 float ImageSource::frameDurationAtIndex(size_t index) const 117 float ImageSource::frameDurationAtIndex(size_t index) const
118 { 118 {
119 if (!m_decoder) 119 if (!m_decoder)
120 return 0; 120 return 0;
121 121
122 // Many annoying ads specify a 0 duration to make an image flash as quickly as possible. 122 // 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 123 // 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> 124 // a duration of <= 10 ms. See <rdar://problem/7689300> and <http://webkit.o rg/b/36082>
(...skipping 18 matching lines...) Expand all
143 { 143 {
144 return m_decoder && m_decoder->frameIsCompleteAtIndex(index); 144 return m_decoder && m_decoder->frameIsCompleteAtIndex(index);
145 } 145 }
146 146
147 unsigned ImageSource::frameBytesAtIndex(size_t index) const 147 unsigned ImageSource::frameBytesAtIndex(size_t index) const
148 { 148 {
149 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; 149 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0;
150 } 150 }
151 151
152 } // namespace blink 152 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/ImageSource.h ('k') | Source/platform/graphics/StaticBitmapImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698