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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 private: | 189 private: |
190 enum SnapshotState { | 190 enum SnapshotState { |
191 InitialSnapshotState, | 191 InitialSnapshotState, |
192 DidAcquireSnapshot, | 192 DidAcquireSnapshot, |
193 DrawnToAfterSnapshot, | 193 DrawnToAfterSnapshot, |
194 }; | 194 }; |
195 mutable SnapshotState m_snapshotState; | 195 mutable SnapshotState m_snapshotState; |
196 std::unique_ptr<ImageBufferSurface> m_surface; | 196 std::unique_ptr<ImageBufferSurface> m_surface; |
197 ImageBufferClient* m_client; | 197 ImageBufferClient* m_client; |
198 | 198 |
199 mutable bool m_gpuReadbackInvokedInCurrentFrame; | |
200 int m_gpuReadbackSuccessiveFrames; | |
201 | |
202 mutable intptr_t m_gpuMemoryUsage; | 199 mutable intptr_t m_gpuMemoryUsage; |
203 static intptr_t s_globalGPUMemoryUsage; | 200 static intptr_t s_globalGPUMemoryUsage; |
204 static unsigned s_globalAcceleratedImageBufferCount; | 201 static unsigned s_globalAcceleratedImageBufferCount; |
205 }; | 202 }; |
206 | 203 |
207 struct ImageDataBuffer { | 204 struct ImageDataBuffer { |
208 STACK_ALLOCATED(); | 205 STACK_ALLOCATED(); |
209 ImageDataBuffer(const IntSize& size, const unsigned char* data) | 206 ImageDataBuffer(const IntSize& size, const unsigned char* data) |
210 : m_data(data), m_size(size) {} | 207 : m_data(data), m_size(size) {} |
211 String PLATFORM_EXPORT toDataURL(const String& mimeType, | 208 String PLATFORM_EXPORT toDataURL(const String& mimeType, |
212 const double& quality) const; | 209 const double& quality) const; |
213 bool PLATFORM_EXPORT encodeImage(const String& mimeType, | 210 bool PLATFORM_EXPORT encodeImage(const String& mimeType, |
214 const double& quality, | 211 const double& quality, |
215 Vector<unsigned char>* encodedImage) const; | 212 Vector<unsigned char>* encodedImage) const; |
216 const unsigned char* pixels() const { return m_data; } | 213 const unsigned char* pixels() const { return m_data; } |
217 const IntSize& size() const { return m_size; } | 214 const IntSize& size() const { return m_size; } |
218 int height() const { return m_size.height(); } | 215 int height() const { return m_size.height(); } |
219 int width() const { return m_size.width(); } | 216 int width() const { return m_size.width(); } |
220 | 217 |
221 const unsigned char* m_data; | 218 const unsigned char* m_data; |
222 const IntSize m_size; | 219 const IntSize m_size; |
223 }; | 220 }; |
224 | 221 |
225 } // namespace blink | 222 } // namespace blink |
226 | 223 |
227 #endif // ImageBuffer_h | 224 #endif // ImageBuffer_h |
OLD | NEW |