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

Side by Side Diff: sky/engine/core/html/canvas/WebGLSharedWebGraphicsContext3D.cpp

Issue 1001913003: Remove <canvas> (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 "sky/engine/config.h"
6 #include "sky/engine/core/html/canvas/WebGLSharedWebGraphicsContext3D.h"
7
8 #if ENABLE(OILPAN)
9 #include "sky/engine/platform/graphics/gpu/DrawingBuffer.h"
10 #include "sky/engine/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
« no previous file with comments | « sky/engine/core/html/canvas/WebGLSharedWebGraphicsContext3D.h ('k') | sky/engine/core/html/canvas/WebGLTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698