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

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: Adjust GC_PLUGIN_IGNORE() bug reference 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 WebCore {
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 if (m_buffer) {
27 m_buffer->beginDestruction();
28 m_buffer.clear();
29 }
30 }
31
32 void WebGLSharedWebGraphicsContext3D::reset()
33 {
34 // Cleared without finalizing.
35 m_buffer.clear();
36 }
37
38 void WebGLSharedWebGraphicsContext3D::update(PassRefPtr<DrawingBuffer> buffer)
39 {
40 m_buffer = buffer;
41 }
42
43 blink::WebGraphicsContext3D* WebGLSharedWebGraphicsContext3D::webContext()
44 {
45 return m_buffer ? m_buffer->context() : 0;
46 }
47
48 } // namespace WebCore
49
50 #endif // ENABLE(OILPAN)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698