OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebGLSharedWebGraphicsContext3D_h |
| 6 #define WebGLSharedWebGraphicsContext3D_h |
| 7 |
| 8 #include "wtf/Forward.h" |
| 9 #include "wtf/RefCounted.h" |
| 10 #include "wtf/RefPtr.h" |
| 11 |
| 12 namespace blink { |
| 13 class WebGraphicsContext3D; |
| 14 } |
| 15 |
| 16 namespace WebCore { |
| 17 |
| 18 class DrawingBuffer; |
| 19 |
| 20 #if ENABLE(OILPAN) |
| 21 // The attached WebGLContextObjects are finalized using the |
| 22 // blink::WebGraphicsContext3D object of this object's DrawingBuffer. |
| 23 // Naturally the DrawingBuffer must then be kept alive until those |
| 24 // finalizers have run. With Oilpan, accomplish that by having the |
| 25 // WebGLContextObjects keep a RefPtr<> to an off-heap object that |
| 26 // safely handles the eventual release of the underlying |
| 27 // DrawingBuffer. |
| 28 class WebGLSharedWebGraphicsContext3D FINAL : public RefCounted<WebGLSharedWebGr
aphicsContext3D> { |
| 29 public: |
| 30 static PassRefPtr<WebGLSharedWebGraphicsContext3D> create(PassRefPtr<Drawing
Buffer>); |
| 31 |
| 32 ~WebGLSharedWebGraphicsContext3D(); |
| 33 |
| 34 // Clearing and updating the underlying DrawingBuffer |
| 35 // is used when losing and restoring graphics contexts. |
| 36 void reset(); |
| 37 void update(PassRefPtr<DrawingBuffer>); |
| 38 |
| 39 blink::WebGraphicsContext3D* webContext(); |
| 40 private: |
| 41 explicit WebGLSharedWebGraphicsContext3D(PassRefPtr<DrawingBuffer>); |
| 42 |
| 43 RefPtr<DrawingBuffer> m_buffer; |
| 44 }; |
| 45 #endif |
| 46 |
| 47 |
| 48 |
| 49 } |
| 50 |
| 51 #endif // WebGLSharedWebGraphicsContext3D_h |
OLD | NEW |