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

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

Issue 1331533002: [poc] curve-filter Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Draw layered images with a recording GraphicContext Created 5 years 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
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 10 matching lines...) Expand all
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #include "config.h" 28 #include "config.h"
29 #include "platform/graphics/ImageSource.h" 29 #include "platform/graphics/ImageSource.h"
30 30
31 #include "platform/graphics/ColorSpaceProfile.h"
31 #include "platform/graphics/DeferredImageDecoder.h" 32 #include "platform/graphics/DeferredImageDecoder.h"
32 #include "platform/image-decoders/ImageDecoder.h" 33 #include "platform/image-decoders/ImageDecoder.h"
33 #include "third_party/skia/include/core/SkImage.h" 34 #include "third_party/skia/include/core/SkImage.h"
34 35
35 namespace blink { 36 namespace blink {
36 37
37 ImageSource::ImageSource() 38 ImageSource::ImageSource()
38 { 39 {
39 } 40 }
40 41
(...skipping 25 matching lines...) Expand all
66 bool ImageSource::isSizeAvailable() 67 bool ImageSource::isSizeAvailable()
67 { 68 {
68 return m_decoder && m_decoder->isSizeAvailable(); 69 return m_decoder && m_decoder->isSizeAvailable();
69 } 70 }
70 71
71 bool ImageSource::hasColorProfile() const 72 bool ImageSource::hasColorProfile() const
72 { 73 {
73 return m_decoder && m_decoder->hasColorProfile(); 74 return m_decoder && m_decoder->hasColorProfile();
74 } 75 }
75 76
77 PassRefPtr<ColorSpaceProfile> ImageSource::colorProfile() const
78 {
79 return m_decoder ? m_decoder->colorProfile() : nullptr;
80 }
81
76 IntSize ImageSource::size(RespectImageOrientationEnum shouldRespectOrientation) const 82 IntSize ImageSource::size(RespectImageOrientationEnum shouldRespectOrientation) const
77 { 83 {
78 return frameSizeAtIndex(0, shouldRespectOrientation); 84 return frameSizeAtIndex(0, shouldRespectOrientation);
79 } 85 }
80 86
81 IntSize ImageSource::frameSizeAtIndex(size_t index, RespectImageOrientationEnum shouldRespectOrientation) const 87 IntSize ImageSource::frameSizeAtIndex(size_t index, RespectImageOrientationEnum shouldRespectOrientation) const
82 { 88 {
83 if (!m_decoder) 89 if (!m_decoder)
84 return IntSize(); 90 return IntSize();
85 91
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 { 148 {
143 return m_decoder && m_decoder->frameIsCompleteAtIndex(index); 149 return m_decoder && m_decoder->frameIsCompleteAtIndex(index);
144 } 150 }
145 151
146 size_t ImageSource::frameBytesAtIndex(size_t index) const 152 size_t ImageSource::frameBytesAtIndex(size_t index) const
147 { 153 {
148 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0; 154 return m_decoder ? m_decoder->frameBytesAtIndex(index) : 0;
149 } 155 }
150 156
151 } // namespace blink 157 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698