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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "platform/PlatformExport.h" | 31 #include "platform/PlatformExport.h" |
32 #include "platform/geometry/FloatRect.h" | 32 #include "platform/geometry/FloatRect.h" |
33 #include "platform/geometry/IntSize.h" | 33 #include "platform/geometry/IntSize.h" |
34 #include "platform/graphics/Canvas2DLayerBridge.h" | 34 #include "platform/graphics/Canvas2DLayerBridge.h" |
35 #include "platform/graphics/GraphicsTypes.h" | 35 #include "platform/graphics/GraphicsTypes.h" |
36 #include "platform/graphics/GraphicsTypes3D.h" | 36 #include "platform/graphics/GraphicsTypes3D.h" |
37 #include "platform/graphics/ImageBufferSurface.h" | 37 #include "platform/graphics/ImageBufferSurface.h" |
38 #include "platform/transforms/AffineTransform.h" | 38 #include "platform/transforms/AffineTransform.h" |
39 #include "third_party/skia/include/core/SkPaint.h" | 39 #include "third_party/skia/include/core/SkPaint.h" |
| 40 #include "third_party/skia/include/core/SkPicture.h" |
40 #include "wtf/Forward.h" | 41 #include "wtf/Forward.h" |
41 #include "wtf/OwnPtr.h" | 42 #include "wtf/OwnPtr.h" |
42 #include "wtf/PassOwnPtr.h" | 43 #include "wtf/PassOwnPtr.h" |
43 #include "wtf/PassRefPtr.h" | 44 #include "wtf/PassRefPtr.h" |
44 #include "wtf/Vector.h" | 45 #include "wtf/Vector.h" |
45 #include "wtf/text/WTFString.h" | 46 #include "wtf/text/WTFString.h" |
46 #include "wtf/typed_arrays/Uint8ClampedArray.h" | 47 #include "wtf/typed_arrays/Uint8ClampedArray.h" |
47 | 48 |
48 namespace gpu { | 49 namespace gpu { |
49 namespace gles2 { | 50 namespace gles2 { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff
er); | 130 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff
er); |
130 | 131 |
131 void flush(FlushReason); // process deferred draw commands immediately | 132 void flush(FlushReason); // process deferred draw commands immediately |
132 void flushGpu(FlushReason); // Like flush(), but flushes all the way down to
the Gpu context if the surface is accelerated | 133 void flushGpu(FlushReason); // Like flush(), but flushes all the way down to
the Gpu context if the surface is accelerated |
133 | 134 |
134 void notifySurfaceInvalid(); | 135 void notifySurfaceInvalid(); |
135 | 136 |
136 PassRefPtr<SkImage> newSkImageSnapshot(AccelerationHint, SnapshotReason) con
st; | 137 PassRefPtr<SkImage> newSkImageSnapshot(AccelerationHint, SnapshotReason) con
st; |
137 PassRefPtr<Image> newImageSnapshot(AccelerationHint = PreferNoAcceleration,
SnapshotReason = SnapshotReasonUnknown) const; | 138 PassRefPtr<Image> newImageSnapshot(AccelerationHint = PreferNoAcceleration,
SnapshotReason = SnapshotReasonUnknown) const; |
138 | 139 |
| 140 PassRefPtr<SkPicture> getPicture() { return m_surface->getPicture(); } |
| 141 |
139 void draw(GraphicsContext&, const FloatRect&, const FloatRect*, SkXfermode::
Mode); | 142 void draw(GraphicsContext&, const FloatRect&, const FloatRect*, SkXfermode::
Mode); |
140 | 143 |
141 void updateGPUMemoryUsage() const; | 144 void updateGPUMemoryUsage() const; |
142 static intptr_t getGlobalGPUMemoryUsage() { return s_globalGPUMemoryUsage; } | 145 static intptr_t getGlobalGPUMemoryUsage() { return s_globalGPUMemoryUsage; } |
143 intptr_t getGPUMemoryUsage() { return m_gpuMemoryUsage; } | 146 intptr_t getGPUMemoryUsage() { return m_gpuMemoryUsage; } |
144 | 147 |
145 protected: | 148 protected: |
146 ImageBuffer(PassOwnPtr<ImageBufferSurface>); | 149 ImageBuffer(PassOwnPtr<ImageBufferSurface>); |
147 | 150 |
148 private: | 151 private: |
(...skipping 19 matching lines...) Expand all Loading... |
168 int height() const { return m_size.height(); } | 171 int height() const { return m_size.height(); } |
169 int width() const { return m_size.width(); } | 172 int width() const { return m_size.width(); } |
170 | 173 |
171 const unsigned char* m_data; | 174 const unsigned char* m_data; |
172 const IntSize m_size; | 175 const IntSize m_size; |
173 }; | 176 }; |
174 | 177 |
175 } // namespace blink | 178 } // namespace blink |
176 | 179 |
177 #endif // ImageBuffer_h | 180 #endif // ImageBuffer_h |
OLD | NEW |