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

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

Issue 9669006: Force a swap on resize to work around Intel driver issues with PostSubBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/gl/gl_surface_glx.h ('k') | no next file » | 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) 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 extern "C" { 5 extern "C" {
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 } 7 }
8 8
9 #include "ui/gfx/gl/gl_surface_glx.h" 9 #include "ui/gfx/gl/gl_surface_glx.h"
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 Destroy(); 117 Destroy();
118 } 118 }
119 119
120 bool NativeViewGLSurfaceGLX::Initialize() { 120 bool NativeViewGLSurfaceGLX::Initialize() {
121 return true; 121 return true;
122 } 122 }
123 123
124 void NativeViewGLSurfaceGLX::Destroy() { 124 void NativeViewGLSurfaceGLX::Destroy() {
125 } 125 }
126 126
127 bool NativeViewGLSurfaceGLX::Resize(const gfx::Size& size) {
128 // On Intel drivers, the frame buffer won't be resize until the next swap. If
129 // we only do PostSubBuffer, then we're stuck in the old size. Force a swap
130 // now.
131 if (gfx::g_GLX_MESA_copy_sub_buffer)
132 SwapBuffers();
133 return true;
134 }
135
127 bool NativeViewGLSurfaceGLX::IsOffscreen() { 136 bool NativeViewGLSurfaceGLX::IsOffscreen() {
128 return false; 137 return false;
129 } 138 }
130 139
131 bool NativeViewGLSurfaceGLX::SwapBuffers() { 140 bool NativeViewGLSurfaceGLX::SwapBuffers() {
132 glXSwapBuffers(g_display, window_); 141 glXSwapBuffers(g_display, window_);
133 return true; 142 return true;
134 } 143 }
135 144
136 gfx::Size NativeViewGLSurfaceGLX::GetSize() { 145 gfx::Size NativeViewGLSurfaceGLX::GetSize() {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 315
307 void* PbufferGLSurfaceGLX::GetHandle() { 316 void* PbufferGLSurfaceGLX::GetHandle() {
308 return reinterpret_cast<void*>(pbuffer_); 317 return reinterpret_cast<void*>(pbuffer_);
309 } 318 }
310 319
311 void* PbufferGLSurfaceGLX::GetConfig() { 320 void* PbufferGLSurfaceGLX::GetConfig() {
312 return config_; 321 return config_;
313 } 322 }
314 323
315 } // namespace gfx 324 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_surface_glx.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698