| 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 17 matching lines...) Expand all Loading... |
| 28 #ifndef ImageBuffer_h | 28 #ifndef ImageBuffer_h |
| 29 #define ImageBuffer_h | 29 #define ImageBuffer_h |
| 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/graphics/paint/DisplayItemClient.h" | |
| 39 #include "platform/transforms/AffineTransform.h" | 38 #include "platform/transforms/AffineTransform.h" |
| 40 #include "third_party/skia/include/core/SkPaint.h" | 39 #include "third_party/skia/include/core/SkPaint.h" |
| 41 #include "wtf/Forward.h" | 40 #include "wtf/Forward.h" |
| 42 #include "wtf/OwnPtr.h" | 41 #include "wtf/OwnPtr.h" |
| 43 #include "wtf/PassOwnPtr.h" | 42 #include "wtf/PassOwnPtr.h" |
| 44 #include "wtf/PassRefPtr.h" | 43 #include "wtf/PassRefPtr.h" |
| 45 #include "wtf/Uint8ClampedArray.h" | 44 #include "wtf/Uint8ClampedArray.h" |
| 46 #include "wtf/Vector.h" | 45 #include "wtf/Vector.h" |
| 47 #include "wtf/text/WTFString.h" | 46 #include "wtf/text/WTFString.h" |
| 48 | 47 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff
er); | 122 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff
er); |
| 124 | 123 |
| 125 void flush(); // process deferred draw commands immediately | 124 void flush(); // process deferred draw commands immediately |
| 126 void flushGpu(); // Like flush(), but flushes all the way down to the Gpu co
ntext if the surface is accelerated | 125 void flushGpu(); // Like flush(), but flushes all the way down to the Gpu co
ntext if the surface is accelerated |
| 127 | 126 |
| 128 void notifySurfaceInvalid(); | 127 void notifySurfaceInvalid(); |
| 129 | 128 |
| 130 PassRefPtr<SkImage> newSkImageSnapshot(AccelerationHint) const; | 129 PassRefPtr<SkImage> newSkImageSnapshot(AccelerationHint) const; |
| 131 PassRefPtr<Image> newImageSnapshot(AccelerationHint = PreferNoAcceleration)
const; | 130 PassRefPtr<Image> newImageSnapshot(AccelerationHint = PreferNoAcceleration)
const; |
| 132 | 131 |
| 133 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } | |
| 134 String debugName() const { return "ImageBuffer"; } | |
| 135 | |
| 136 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode::
Mode); | 132 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode::
Mode); |
| 137 | 133 |
| 138 private: | 134 private: |
| 139 ImageBuffer(PassOwnPtr<ImageBufferSurface>); | 135 ImageBuffer(PassOwnPtr<ImageBufferSurface>); |
| 140 | 136 |
| 141 enum SnapshotState { | 137 enum SnapshotState { |
| 142 InitialSnapshotState, | 138 InitialSnapshotState, |
| 143 DidAcquireSnapshot, | 139 DidAcquireSnapshot, |
| 144 DrawnToAfterSnapshot, | 140 DrawnToAfterSnapshot, |
| 145 }; | 141 }; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 157 int height() const { return m_size.height(); } | 153 int height() const { return m_size.height(); } |
| 158 int width() const { return m_size.width(); } | 154 int width() const { return m_size.width(); } |
| 159 | 155 |
| 160 const unsigned char* m_data; | 156 const unsigned char* m_data; |
| 161 const IntSize m_size; | 157 const IntSize m_size; |
| 162 }; | 158 }; |
| 163 | 159 |
| 164 } // namespace blink | 160 } // namespace blink |
| 165 | 161 |
| 166 #endif // ImageBuffer_h | 162 #endif // ImageBuffer_h |
| OLD | NEW |