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

Unified Diff: ui/gl/gl_surface.cc

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_surface.h ('k') | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface.cc
diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc
index 1d5598e20e44aa24a2ad5f06d3b356b8839ad5ed..f4cb61c0bdcb564d5eb4535cbaf895070992df94 100644
--- a/ui/gl/gl_surface.cc
+++ b/ui/gl/gl_surface.cc
@@ -37,7 +37,7 @@ bool GLSurface::InitializeOneOff(GLImplementation impl) {
GetAllowedGLImplementations(&allowed_impls);
DCHECK(!allowed_impls.empty());
- CommandLine* cmd = CommandLine::ForCurrentProcess();
+ base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
// The default implementation is always the first one in list.
if (impl == kGLImplementationNone)
@@ -109,7 +109,8 @@ void GLSurface::InitializeOneOffForTests() {
// We usually use OSMesa as this works on all bots. The command line can
// override this behaviour to use hardware GL.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGpuInTests))
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kUseGpuInTests))
use_osmesa = false;
#if defined(OS_ANDROID)
@@ -125,7 +126,7 @@ void GLSurface::InitializeOneOffForTests() {
if (use_osmesa)
impl = kGLImplementationOSMesaGL;
- DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL))
+ DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL))
<< "kUseGL has not effect in tests";
bool fallback_to_osmesa = false;
@@ -138,7 +139,7 @@ void GLSurface::InitializeOneOffForTests() {
// static
void GLSurface::InitializeOneOffWithMockBindingsForTests() {
- DCHECK(!CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL))
+ DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL))
<< "kUseGL has not effect in tests";
// This method may be called multiple times in the same process to set up
@@ -192,10 +193,27 @@ unsigned int GLSurface::GetBackingFrameBufferObject() {
return 0;
}
+bool GLSurface::SwapBuffersAsync(const SwapCompletionCallback& callback) {
+ DCHECK(!IsSurfaceless());
+ bool success = SwapBuffers();
+ callback.Run();
+ return success;
+}
+
bool GLSurface::PostSubBuffer(int x, int y, int width, int height) {
return false;
}
+bool GLSurface::PostSubBufferAsync(int x,
+ int y,
+ int width,
+ int height,
+ const SwapCompletionCallback& callback) {
+ bool success = PostSubBuffer(x, y, width, height);
+ callback.Run();
+ return success;
+}
+
bool GLSurface::OnMakeCurrent(GLContext* context) {
return true;
}
@@ -303,10 +321,21 @@ bool GLSurfaceAdapter::SwapBuffers() {
return surface_->SwapBuffers();
}
+bool GLSurfaceAdapter::SwapBuffersAsync(
+ const SwapCompletionCallback& callback) {
+ return surface_->SwapBuffersAsync(callback);
+}
+
bool GLSurfaceAdapter::PostSubBuffer(int x, int y, int width, int height) {
return surface_->PostSubBuffer(x, y, width, height);
}
+bool GLSurfaceAdapter::PostSubBufferAsync(
+ int x, int y, int width, int height,
+ const SwapCompletionCallback& callback) {
+ return surface_->PostSubBufferAsync(x, y, width, height, callback);
+}
+
bool GLSurfaceAdapter::SupportsPostSubBuffer() {
return surface_->SupportsPostSubBuffer();
}
« no previous file with comments | « ui/gl/gl_surface.h ('k') | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698