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

Side by Side Diff: ui/gl/gl_context_stub.cc

Issue 2136223002: Introduce GLStubApi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_context_stub.h" 5 #include "ui/gl/gl_context_stub.h"
6 6
7 #include "ui/gl/gl_gl_api_implementation.h"
8
7 namespace gl { 9 namespace gl {
8 10
9 GLContextStub::GLContextStub() : GLContextReal(nullptr) {} 11 GLContextStub::GLContextStub() : GLContextReal(nullptr) {}
10 GLContextStub::GLContextStub(GLShareGroup* share_group) 12 GLContextStub::GLContextStub(GLShareGroup* share_group)
11 : GLContextReal(share_group) {} 13 : GLContextReal(share_group) {}
12 14
13 bool GLContextStub::Initialize( 15 bool GLContextStub::Initialize(
14 GLSurface* compatible_surface, GpuPreference gpu_preference) { 16 GLSurface* compatible_surface, GpuPreference gpu_preference) {
15 return true; 17 return true;
16 } 18 }
17 19
18 bool GLContextStub::MakeCurrent(GLSurface* surface) { 20 bool GLContextStub::MakeCurrent(GLSurface* surface) {
19 SetRealGLApi(); 21 SetGLToStubGLApi();
20 SetCurrent(surface); 22 SetCurrent(surface);
21 InitializeDynamicBindings(); 23 InitializeDynamicBindings();
22 return true; 24 return true;
23 } 25 }
24 26
25 void GLContextStub::ReleaseCurrent(GLSurface* surface) { 27 void GLContextStub::ReleaseCurrent(GLSurface* surface) {
26 SetCurrent(nullptr); 28 SetCurrent(nullptr);
27 } 29 }
28 30
29 bool GLContextStub::IsCurrent(GLSurface* surface) { 31 bool GLContextStub::IsCurrent(GLSurface* surface) {
30 return GetRealCurrent() == this; 32 return GetRealCurrent() == this;
31 } 33 }
32 34
33 void* GLContextStub::GetHandle() { 35 void* GLContextStub::GetHandle() {
34 return nullptr; 36 return nullptr;
35 } 37 }
36 38
37 void GLContextStub::OnSetSwapInterval(int interval) { 39 void GLContextStub::OnSetSwapInterval(int interval) {
38 } 40 }
39 41
40 std::string GLContextStub::GetGLRenderer() { 42 std::string GLContextStub::GetGLRenderer() {
41 return std::string("CHROMIUM"); 43 return std::string("CHROMIUM");
42 } 44 }
43 45
44 GLContextStub::~GLContextStub() {} 46 GLContextStub::~GLContextStub() {}
45 47
46 } // namespace gl 48 } // namespace gl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698