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

Side by Side Diff: gpu/gles2_conform_support/egl/surface.cc

Issue 1714883002: command_buffer_gles2: Implement EGL default Display as a global object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@command_buffer_gles2-multiple-contexts
Patch Set: workaround gtf Created 4 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "gpu/gles2_conform_support/egl/surface.h" 5 #include "gpu/gles2_conform_support/egl/surface.h"
6 #include "ui/gl/gl_surface.h"
6 7
7 namespace egl { 8 namespace egl {
8 9
9 Surface::Surface(EGLNativeWindowType win) : window_(win) { 10 Surface::Surface(gfx::GLSurface* gl_surface)
10 } 11 : is_current_in_some_thread_(false), gl_surface_(gl_surface) {}
11 12
12 Surface::~Surface() { 13 Surface::~Surface() {
13 } 14 }
14 15
16 gfx::GLSurface* Surface::gl_surface() const {
17 return gl_surface_.get();
18 }
19
20 bool Surface::ValidatePbufferAttributeList(const EGLint* attrib_list) {
21 if (attrib_list) {
22 for (int i = 0; attrib_list[i] != EGL_NONE; i += 2) {
23 switch (attrib_list[i]) {
24 case EGL_WIDTH:
25 case EGL_HEIGHT:
26 break;
27 default:
28 return false;
29 }
30 }
31 }
32 return true;
33 }
34
35 bool Surface::ValidateWindowAttributeList(const EGLint* attrib_list) {
36 if (attrib_list) {
37 if (attrib_list[0] != EGL_NONE)
38 return false;
39 }
40 return true;
41 }
15 } // namespace egl 42 } // namespace egl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698