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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 class ImageBufferClient; | 60 class ImageBufferClient; |
61 class IntPoint; | 61 class IntPoint; |
62 class IntRect; | 62 class IntRect; |
63 class WebGraphicsContext3D; | 63 class WebGraphicsContext3D; |
64 | 64 |
65 enum Multiply { | 65 enum Multiply { |
66 Premultiplied, | 66 Premultiplied, |
67 Unmultiplied | 67 Unmultiplied |
68 }; | 68 }; |
69 | 69 |
70 class PLATFORM_EXPORT ImageBuffer { | 70 class PLATFORM_EXPORT ImageBuffer /* : public DisplayItemClient */ { |
pdr.
2015/12/05 21:39:19
Is this not needed? Can we remove both DisplayItem
Xianzhu
2015/12/07 17:14:01
I added it and tried compile to see if it's really
| |
71 WTF_MAKE_NONCOPYABLE(ImageBuffer); USING_FAST_MALLOC(ImageBuffer); | 71 WTF_MAKE_NONCOPYABLE(ImageBuffer); USING_FAST_MALLOC(ImageBuffer); |
72 public: | 72 public: |
73 static PassOwnPtr<ImageBuffer> create(const IntSize&, OpacityMode = NonOpaqu e, ImageInitializationMode = InitializeImagePixels); | 73 static PassOwnPtr<ImageBuffer> create(const IntSize&, OpacityMode = NonOpaqu e, ImageInitializationMode = InitializeImagePixels); |
74 static PassOwnPtr<ImageBuffer> create(PassOwnPtr<ImageBufferSurface>); | 74 static PassOwnPtr<ImageBuffer> create(PassOwnPtr<ImageBufferSurface>); |
75 | 75 |
76 ~ImageBuffer(); | 76 ~ImageBuffer(); |
77 | 77 |
78 void setClient(ImageBufferClient* client) { m_client = client; } | 78 void setClient(ImageBufferClient* client) { m_client = client; } |
79 | 79 |
80 const IntSize& size() const { return m_surface->size(); } | 80 const IntSize& size() const { return m_surface->size(); } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff er); | 123 bool copyRenderingResultsFromDrawingBuffer(DrawingBuffer*, SourceDrawingBuff er); |
124 | 124 |
125 void flush(); // process deferred draw commands immediately | 125 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 | 126 void flushGpu(); // Like flush(), but flushes all the way down to the Gpu co ntext if the surface is accelerated |
127 | 127 |
128 void notifySurfaceInvalid(); | 128 void notifySurfaceInvalid(); |
129 | 129 |
130 PassRefPtr<SkImage> newSkImageSnapshot(AccelerationHint) const; | 130 PassRefPtr<SkImage> newSkImageSnapshot(AccelerationHint) const; |
131 PassRefPtr<Image> newImageSnapshot(AccelerationHint = PreferNoAcceleration) const; | 131 PassRefPtr<Image> newImageSnapshot(AccelerationHint = PreferNoAcceleration) const; |
132 | 132 |
133 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } | |
134 String debugName() const { return "ImageBuffer"; } | 133 String debugName() const { return "ImageBuffer"; } |
135 | 134 |
136 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode:: Mode); | 135 void draw(GraphicsContext*, const FloatRect&, const FloatRect*, SkXfermode:: Mode); |
137 | 136 |
138 private: | 137 private: |
139 ImageBuffer(PassOwnPtr<ImageBufferSurface>); | 138 ImageBuffer(PassOwnPtr<ImageBufferSurface>); |
140 | 139 |
141 enum SnapshotState { | 140 enum SnapshotState { |
142 InitialSnapshotState, | 141 InitialSnapshotState, |
143 DidAcquireSnapshot, | 142 DidAcquireSnapshot, |
(...skipping 13 matching lines...) Expand all Loading... | |
157 int height() const { return m_size.height(); } | 156 int height() const { return m_size.height(); } |
158 int width() const { return m_size.width(); } | 157 int width() const { return m_size.width(); } |
159 | 158 |
160 const unsigned char* m_data; | 159 const unsigned char* m_data; |
161 const IntSize m_size; | 160 const IntSize m_size; |
162 }; | 161 }; |
163 | 162 |
164 } // namespace blink | 163 } // namespace blink |
165 | 164 |
166 #endif // ImageBuffer_h | 165 #endif // ImageBuffer_h |
OLD | NEW |