OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 class PLATFORM_EXPORT Canvas2DLayerBridge : public NON_EXPORTED_BASE(cc::Texture
LayerClient), public WebThread::TaskObserver, public RefCounted<Canvas2DLayerBri
dge> { | 79 class PLATFORM_EXPORT Canvas2DLayerBridge : public NON_EXPORTED_BASE(cc::Texture
LayerClient), public WebThread::TaskObserver, public RefCounted<Canvas2DLayerBri
dge> { |
80 WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge); | 80 WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge); |
81 public: | 81 public: |
82 enum AccelerationMode { | 82 enum AccelerationMode { |
83 DisableAcceleration, | 83 DisableAcceleration, |
84 EnableAcceleration, | 84 EnableAcceleration, |
85 ForceAccelerationForTesting, | 85 ForceAccelerationForTesting, |
86 }; | 86 }; |
87 | 87 |
88 static PassRefPtr<Canvas2DLayerBridge> create(const IntSize&, int msaaSample
Count, OpacityMode, AccelerationMode); | 88 Canvas2DLayerBridge(std::unique_ptr<WebGraphicsContext3DProvider>, const Int
Size&, int msaaSampleCount, OpacityMode, AccelerationMode); |
89 | |
90 ~Canvas2DLayerBridge() override; | 89 ~Canvas2DLayerBridge() override; |
91 | 90 |
92 // cc::TextureLayerClient implementation. | 91 // cc::TextureLayerClient implementation. |
93 bool PrepareTextureMailbox( | 92 bool PrepareTextureMailbox( |
94 cc::TextureMailbox* outMailbox, | 93 cc::TextureMailbox* outMailbox, |
95 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback, | 94 std::unique_ptr<cc::SingleReleaseCallback>* outReleaseCallback, |
96 bool useSharedMemory) override; | 95 bool useSharedMemory) override; |
97 | 96 |
98 // Callback for mailboxes given to the compositor from PrepareTextureMailbox
. | 97 // Callback for mailboxes given to the compositor from PrepareTextureMailbox
. |
99 void mailboxReleased(const gpu::Mailbox&, const gpu::SyncToken&, | 98 void mailboxReleased(const gpu::Mailbox&, const gpu::SyncToken&, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 #if USE_IOSURFACE_FOR_2D_CANVAS | 181 #if USE_IOSURFACE_FOR_2D_CANVAS |
183 // If this mailbox wraps an IOSurface-backed texture, the ids of the | 182 // If this mailbox wraps an IOSurface-backed texture, the ids of the |
184 // CHROMIUM image and the texture. | 183 // CHROMIUM image and the texture. |
185 ImageInfo m_imageInfo; | 184 ImageInfo m_imageInfo; |
186 #endif // USE_IOSURFACE_FOR_2D_CANVAS | 185 #endif // USE_IOSURFACE_FOR_2D_CANVAS |
187 | 186 |
188 MailboxInfo(const MailboxInfo&); | 187 MailboxInfo(const MailboxInfo&); |
189 MailboxInfo(); | 188 MailboxInfo(); |
190 }; | 189 }; |
191 | 190 |
192 Canvas2DLayerBridge(std::unique_ptr<WebGraphicsContext3DProvider>, const Int
Size&, int msaaSampleCount, OpacityMode, AccelerationMode); | |
193 gpu::gles2::GLES2Interface* contextGL(); | 191 gpu::gles2::GLES2Interface* contextGL(); |
194 void startRecording(); | 192 void startRecording(); |
195 void skipQueuedDrawCommands(); | 193 void skipQueuedDrawCommands(); |
196 void flushRecordingOnly(); | 194 void flushRecordingOnly(); |
197 void unregisterTaskObserver(); | 195 void unregisterTaskObserver(); |
198 void reportSurfaceCreationFailure(); | 196 void reportSurfaceCreationFailure(); |
199 | 197 |
200 // WebThread::TaskOberver implementation | 198 // WebThread::TaskOberver implementation |
201 void willProcessTask() override; | 199 void willProcessTask() override; |
202 void didProcessTask() override; | 200 void didProcessTask() override; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 // Each element in this vector represents an IOSurface backed texture that | 281 // Each element in this vector represents an IOSurface backed texture that |
284 // is ready to be reused. | 282 // is ready to be reused. |
285 // Elements in this vector can safely be purged in low memory conditions. | 283 // Elements in this vector can safely be purged in low memory conditions. |
286 Vector<ImageInfo> m_imageInfoCache; | 284 Vector<ImageInfo> m_imageInfoCache; |
287 #endif // USE_IOSURFACE_FOR_2D_CANVAS | 285 #endif // USE_IOSURFACE_FOR_2D_CANVAS |
288 }; | 286 }; |
289 | 287 |
290 } // namespace blink | 288 } // namespace blink |
291 | 289 |
292 #endif | 290 #endif |
OLD | NEW |