Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: Source/core/html/canvas/WebGLSharedWebGraphicsContext3D.h

Issue 365653002: Oilpan: move 2D Canvas and WebGL objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have Nullable<T>::trace() use TraceIfNeeded<>. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 // Disposing and updating the underlying DrawingBuffer;
35 // needed when handling loss and restoration of graphics contexts.
36 void dispose();
37 void update(PassRefPtr<DrawingBuffer>);
38
39 DrawingBuffer* drawingBuffer() const;
40
41 blink::WebGraphicsContext3D* webContext() const;
42 private:
43 explicit WebGLSharedWebGraphicsContext3D(PassRefPtr<DrawingBuffer>);
44
45 RefPtr<DrawingBuffer> m_buffer;
46 };
47 #endif
48
49
50
51 }
52
53 #endif // WebGLSharedWebGraphicsContext3D_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698