OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. |
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 void putByteArray(Multiply, const unsigned char* source, const IntSize& sour
ceSize, const IntRect& sourceRect, const IntPoint& destPoint); | 116 void putByteArray(Multiply, const unsigned char* source, const IntSize& sour
ceSize, const IntRect& sourceRect, const IntPoint& destPoint); |
117 | 117 |
118 AffineTransform baseTransform() const { return AffineTransform(); } | 118 AffineTransform baseTransform() const { return AffineTransform(); } |
119 WebLayer* platformLayer() const; | 119 WebLayer* platformLayer() const; |
120 | 120 |
121 // FIXME: current implementations of this method have the restriction that t
hey only work | 121 // FIXME: current implementations of this method have the restriction that t
hey only work |
122 // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0
, as specified in | 122 // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0
, as specified in |
123 // Extensions3D::canUseCopyTextureCHROMIUM(). | 123 // Extensions3D::canUseCopyTextureCHROMIUM(). |
124 // Destroys the TEXTURE_2D binding for the active texture unit of the passed
context | 124 // Destroys the TEXTURE_2D binding for the active texture unit of the passed
context |
125 bool copyToPlatformTexture(WebGraphicsContext3D*, GLenum, Platform3DObject,
GLenum, GLenum, GLint, bool, bool); | 125 bool copyToPlatformTexture(WebGraphicsContext3D*, Platform3DObject, GLenum,
GLenum, GLint, bool, bool); |
126 bool copySubToPlatformTexture(WebGraphicsContext3D*, GLenum, Platform3DObjec
t, GLint, GLint xoffset, | |
127 GLint yoffset, GLsizei width, GLsizei height, bool, bool); | |
128 | 126 |
129 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff
er); | 127 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff
er); |
130 | 128 |
131 void flush(); // process deferred draw commands immediately | 129 void flush(); // process deferred draw commands immediately |
132 void flushGpu(); // Like flush(), but flushes all the way down to the Gpu co
ntext if the surface is accelerated | 130 void flushGpu(); // Like flush(), but flushes all the way down to the Gpu co
ntext if the surface is accelerated |
133 | 131 |
134 void notifySurfaceInvalid(); | 132 void notifySurfaceInvalid(); |
135 | 133 |
136 PassRefPtr<SkImage> newSkImageSnapshot(AccelerationHint) const; | 134 PassRefPtr<SkImage> newSkImageSnapshot(AccelerationHint) const; |
137 PassRefPtr<Image> newImageSnapshot(AccelerationHint = PreferNoAcceleration)
const; | 135 PassRefPtr<Image> newImageSnapshot(AccelerationHint = PreferNoAcceleration)
const; |
138 | 136 |
139 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } | 137 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } |
140 String debugName() const { return "ImageBuffer"; } | 138 String debugName() const { return "ImageBuffer"; } |
141 | 139 |
142 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode::
Mode); | 140 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode::
Mode); |
143 | 141 |
144 private: | 142 private: |
145 ImageBuffer(PassOwnPtr<ImageBufferSurface>); | 143 ImageBuffer(PassOwnPtr<ImageBufferSurface>); |
146 | 144 |
147 enum SnapshotState { | 145 enum SnapshotState { |
148 InitialSnapshotState, | 146 InitialSnapshotState, |
149 DidAcquireSnapshot, | 147 DidAcquireSnapshot, |
150 DrawnToAfterSnapshot, | 148 DrawnToAfterSnapshot, |
151 }; | 149 }; |
152 mutable SnapshotState m_snapshotState; | 150 mutable SnapshotState m_snapshotState; |
153 | |
154 bool copyToPlatformTextureInternal(bool isFullCopy, WebGraphicsContext3D*, G
Lenum, Platform3DObject, GLenum, GLenum, | |
155 GLint, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, bool
, bool); | |
156 | |
157 OwnPtr<ImageBufferSurface> m_surface; | 151 OwnPtr<ImageBufferSurface> m_surface; |
158 ImageBufferClient* m_client; | 152 ImageBufferClient* m_client; |
159 }; | 153 }; |
160 | 154 |
161 struct ImageDataBuffer { | 155 struct ImageDataBuffer { |
162 ImageDataBuffer(const IntSize& size, const unsigned char* data) : m_data(dat
a), m_size(size) { } | 156 ImageDataBuffer(const IntSize& size, const unsigned char* data) : m_data(dat
a), m_size(size) { } |
163 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double& quali
ty) const; | 157 String PLATFORM_EXPORT toDataURL(const String& mimeType, const double& quali
ty) const; |
164 bool PLATFORM_EXPORT encodeImage(const String& mimeType, const double& quali
ty, Vector<char>* output) const; | 158 bool PLATFORM_EXPORT encodeImage(const String& mimeType, const double& quali
ty, Vector<char>* output) const; |
165 const unsigned char* pixels() const { return m_data; } | 159 const unsigned char* pixels() const { return m_data; } |
166 int height() const { return m_size.height(); } | 160 int height() const { return m_size.height(); } |
167 int width() const { return m_size.width(); } | 161 int width() const { return m_size.width(); } |
168 | 162 |
169 const unsigned char* m_data; | 163 const unsigned char* m_data; |
170 const IntSize m_size; | 164 const IntSize m_size; |
171 }; | 165 }; |
172 | 166 |
173 } // namespace blink | 167 } // namespace blink |
174 | 168 |
175 #endif // ImageBuffer_h | 169 #endif // ImageBuffer_h |
OLD | NEW |