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

Side by Side Diff: ui/gfx/gl/gl_surface_egl.cc

Issue 8566041: Allow GLSurface to indicate that it supports a specific extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gpu_unittests. Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/gl/gl_surface_egl.h ('k') | ui/gfx/gl/gl_surface_glx.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 "ui/gfx/gl/gl_surface_egl.h" 5 #include "ui/gfx/gl/gl_surface_egl.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "third_party/angle/include/EGL/egl.h" 10 #include "third_party/angle/include/EGL/egl.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 return gfx::Size(); 255 return gfx::Size();
256 } 256 }
257 257
258 return gfx::Size(width, height); 258 return gfx::Size(width, height);
259 } 259 }
260 260
261 EGLSurface NativeViewGLSurfaceEGL::GetHandle() { 261 EGLSurface NativeViewGLSurfaceEGL::GetHandle() {
262 return surface_; 262 return surface_;
263 } 263 }
264 264
265 bool NativeViewGLSurfaceEGL::SupportsPostSubBuffer() { 265 std::string NativeViewGLSurfaceEGL::GetExtensions() {
266 return supports_post_sub_buffer_; 266 std::string extensions = GLSurface::GetExtensions();
267 if (supports_post_sub_buffer_) {
268 extensions += extensions.empty() ? "" : " ";
269 extensions += "GL_CHROMIUM_post_sub_buffer";
270 }
271 return extensions;
267 } 272 }
268 273
269 bool NativeViewGLSurfaceEGL::PostSubBuffer( 274 bool NativeViewGLSurfaceEGL::PostSubBuffer(
270 int x, int y, int width, int height) { 275 int x, int y, int width, int height) {
271 DCHECK(supports_post_sub_buffer_); 276 DCHECK(supports_post_sub_buffer_);
272 if (!eglPostSubBufferNV(GetDisplay(), surface_, x, y, width, height)) { 277 if (!eglPostSubBufferNV(GetDisplay(), surface_, x, y, width, height)) {
273 VLOG(1) << "eglPostSubBufferNV failed with error " 278 VLOG(1) << "eglPostSubBufferNV failed with error "
274 << GetLastEGLErrorString(); 279 << GetLastEGLErrorString();
275 return false; 280 return false;
276 } 281 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 GetHandle(), 365 GetHandle(),
361 EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE, 366 EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE,
362 &handle)) { 367 &handle)) {
363 return NULL; 368 return NULL;
364 } 369 }
365 370
366 return handle; 371 return handle;
367 } 372 }
368 373
369 } // namespace gfx 374 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_surface_egl.h ('k') | ui/gfx/gl/gl_surface_glx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698