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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } // namespace WTF | 59 } // namespace WTF |
60 | 60 |
61 namespace blink { | 61 namespace blink { |
62 | 62 |
63 class DrawingBuffer; | 63 class DrawingBuffer; |
64 class GraphicsContext; | 64 class GraphicsContext; |
65 class Image; | 65 class Image; |
66 class ImageBufferClient; | 66 class ImageBufferClient; |
67 class IntPoint; | 67 class IntPoint; |
68 class IntRect; | 68 class IntRect; |
69 class WebGraphicsContext3D; | |
70 | 69 |
71 enum Multiply { | 70 enum Multiply { |
72 Premultiplied, | 71 Premultiplied, |
73 Unmultiplied | 72 Unmultiplied |
74 }; | 73 }; |
75 | 74 |
76 class PLATFORM_EXPORT ImageBuffer { | 75 class PLATFORM_EXPORT ImageBuffer { |
77 WTF_MAKE_NONCOPYABLE(ImageBuffer); USING_FAST_MALLOC(ImageBuffer); | 76 WTF_MAKE_NONCOPYABLE(ImageBuffer); USING_FAST_MALLOC(ImageBuffer); |
78 public: | 77 public: |
79 static PassOwnPtr<ImageBuffer> create(const IntSize&, OpacityMode = NonOpaqu
e, ImageInitializationMode = InitializeImagePixels); | 78 static PassOwnPtr<ImageBuffer> create(const IntSize&, OpacityMode = NonOpaqu
e, ImageInitializationMode = InitializeImagePixels); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 117 |
119 void putByteArray(Multiply, const unsigned char* source, const IntSize& sour
ceSize, const IntRect& sourceRect, const IntPoint& destPoint); | 118 void putByteArray(Multiply, const unsigned char* source, const IntSize& sour
ceSize, const IntRect& sourceRect, const IntPoint& destPoint); |
120 | 119 |
121 AffineTransform baseTransform() const { return AffineTransform(); } | 120 AffineTransform baseTransform() const { return AffineTransform(); } |
122 WebLayer* platformLayer() const; | 121 WebLayer* platformLayer() const; |
123 | 122 |
124 // FIXME: current implementations of this method have the restriction that t
hey only work | 123 // FIXME: current implementations of this method have the restriction that t
hey only work |
125 // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0
, as specified in | 124 // with textures that are RGB or RGBA format, UNSIGNED_BYTE type and level 0
, as specified in |
126 // Extensions3D::canUseCopyTextureCHROMIUM(). | 125 // Extensions3D::canUseCopyTextureCHROMIUM(). |
127 // Destroys the TEXTURE_2D binding for the active texture unit of the passed
context | 126 // Destroys the TEXTURE_2D binding for the active texture unit of the passed
context |
128 bool copyToPlatformTexture(WebGraphicsContext3D*, gpu::gles2::GLES2Interface
*, Platform3DObject, GLenum, GLenum, GLint, bool, bool); | 127 bool copyToPlatformTexture(gpu::gles2::GLES2Interface*, Platform3DObject, GL
enum, GLenum, GLint, bool, bool); |
129 | 128 |
130 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff
er); | 129 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff
er); |
131 | 130 |
132 void flush(FlushReason); // process deferred draw commands immediately | 131 void flush(FlushReason); // process deferred draw commands immediately |
133 void flushGpu(FlushReason); // Like flush(), but flushes all the way down to
the Gpu context if the surface is accelerated | 132 void flushGpu(FlushReason); // Like flush(), but flushes all the way down to
the Gpu context if the surface is accelerated |
134 | 133 |
135 void notifySurfaceInvalid(); | 134 void notifySurfaceInvalid(); |
136 | 135 |
137 PassRefPtr<SkImage> newSkImageSnapshot(AccelerationHint, SnapshotReason) con
st; | 136 PassRefPtr<SkImage> newSkImageSnapshot(AccelerationHint, SnapshotReason) con
st; |
138 PassRefPtr<Image> newImageSnapshot(AccelerationHint = PreferNoAcceleration,
SnapshotReason = SnapshotReasonUnknown) const; | 137 PassRefPtr<Image> newImageSnapshot(AccelerationHint = PreferNoAcceleration,
SnapshotReason = SnapshotReasonUnknown) const; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 int height() const { return m_size.height(); } | 170 int height() const { return m_size.height(); } |
172 int width() const { return m_size.width(); } | 171 int width() const { return m_size.width(); } |
173 | 172 |
174 const unsigned char* m_data; | 173 const unsigned char* m_data; |
175 const IntSize m_size; | 174 const IntSize m_size; |
176 }; | 175 }; |
177 | 176 |
178 } // namespace blink | 177 } // namespace blink |
179 | 178 |
180 #endif // ImageBuffer_h | 179 #endif // ImageBuffer_h |
OLD | NEW |