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

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

Issue 1900563007: Revert of 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: Created 4 years, 8 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
« no previous file with comments | « gpu/gles2_conform_support/egl/surface.h ('k') | gpu/gles2_conform_support/egl/test_support.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
7 6
8 namespace egl { 7 namespace egl {
9 8
10 Surface::Surface(gfx::GLSurface* gl_surface, const Config* config) 9 Surface::Surface(EGLNativeWindowType win) : window_(win) {
11 : is_current_in_some_thread_(false), 10 }
12 gl_surface_(gl_surface),
13 config_(config) {}
14 11
15 Surface::~Surface() { 12 Surface::~Surface() {
16 } 13 }
17 14
18 gfx::GLSurface* Surface::gl_surface() const {
19 return gl_surface_.get();
20 }
21
22 const Config* Surface::config() const {
23 return config_;
24 }
25
26 bool Surface::ValidatePbufferAttributeList(const EGLint* attrib_list) {
27 if (attrib_list) {
28 for (int i = 0; attrib_list[i] != EGL_NONE; i += 2) {
29 switch (attrib_list[i]) {
30 case EGL_WIDTH:
31 case EGL_HEIGHT:
32 break;
33 default:
34 return false;
35 }
36 }
37 }
38 return true;
39 }
40
41 bool Surface::ValidateWindowAttributeList(const EGLint* attrib_list) {
42 if (attrib_list) {
43 if (attrib_list[0] != EGL_NONE)
44 return false;
45 }
46 return true;
47 }
48 } // namespace egl 15 } // namespace egl
OLDNEW
« no previous file with comments | « gpu/gles2_conform_support/egl/surface.h ('k') | gpu/gles2_conform_support/egl/test_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698