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

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

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: Smaller adjustments 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 #include "config.h"
6 #include "core/html/canvas/WebGLSharedWebGraphicsContext3D.h"
7
8 #if ENABLE(OILPAN)
9 #include "platform/graphics/gpu/DrawingBuffer.h"
10 #include "public/platform/WebGraphicsContext3D.h"
11
12 namespace blink {
13
14 PassRefPtr<WebGLSharedWebGraphicsContext3D> WebGLSharedWebGraphicsContext3D::cre ate(PassRefPtr<DrawingBuffer> buffer)
15 {
16 return adoptRef(new WebGLSharedWebGraphicsContext3D(buffer));
17 }
18
19 WebGLSharedWebGraphicsContext3D::WebGLSharedWebGraphicsContext3D(PassRefPtr<Draw ingBuffer> buffer)
20 : m_buffer(buffer)
21 {
22 }
23
24 WebGLSharedWebGraphicsContext3D::~WebGLSharedWebGraphicsContext3D()
25 {
26 dispose();
27 }
28
29 void WebGLSharedWebGraphicsContext3D::dispose()
30 {
31 if (m_buffer) {
32 m_buffer->beginDestruction();
33 m_buffer.clear();
34 }
35 }
36
37 void WebGLSharedWebGraphicsContext3D::update(PassRefPtr<DrawingBuffer> buffer)
38 {
39 m_buffer = buffer;
40 }
41
42 DrawingBuffer* WebGLSharedWebGraphicsContext3D::drawingBuffer() const
43 {
44 return m_buffer.get();
45 }
46
47 blink::WebGraphicsContext3D* WebGLSharedWebGraphicsContext3D::webContext() const
48 {
49 return m_buffer ? m_buffer->context() : 0;
50 }
51
52 } // namespace blink
53
54 #endif // ENABLE(OILPAN)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698