OLD | NEW |
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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "content/common/gpu/image_transport_surface.h" | 7 #include "content/common/gpu/image_transport_surface.h" |
8 | 8 |
9 // This conflicts with the defines in Xlib.h and must come first. | 9 // This conflicts with the defines in Xlib.h and must come first. |
10 #include "content/common/gpu/gpu_messages.h" | 10 #include "content/common/gpu/gpu_messages.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 glXWaitX(); | 506 glXWaitX(); |
507 } | 507 } |
508 | 508 |
509 void GLXImageTransportSurface::OnResize(gfx::Size size) { | 509 void GLXImageTransportSurface::OnResize(gfx::Size size) { |
510 TRACE_EVENT0("gpu", "GLXImageTransportSurface::OnResize"); | 510 TRACE_EVENT0("gpu", "GLXImageTransportSurface::OnResize"); |
511 size_ = size; | 511 size_ = size; |
512 | 512 |
513 Display* dpy = static_cast<Display*>(GetDisplay()); | 513 Display* dpy = static_cast<Display*>(GetDisplay()); |
514 XResizeWindow(dpy, window_, size_.width(), size_.height()); | 514 XResizeWindow(dpy, window_, size_.width(), size_.height()); |
515 glXWaitX(); | 515 glXWaitX(); |
| 516 // Seems necessary to perform a swap after a resize |
| 517 // in order to resize the front and back buffers (Intel driver bug). |
| 518 // This doesn't always happen with scissoring enabled, so do it now. |
| 519 if (gfx::g_GLX_MESA_copy_sub_buffer) |
| 520 gfx::NativeViewGLSurfaceGLX::SwapBuffers(); |
516 needs_resize_ = true; | 521 needs_resize_ = true; |
517 } | 522 } |
518 | 523 |
519 bool GLXImageTransportSurface::SwapBuffers() { | 524 bool GLXImageTransportSurface::SwapBuffers() { |
520 gfx::NativeViewGLSurfaceGLX::SwapBuffers(); | 525 gfx::NativeViewGLSurfaceGLX::SwapBuffers(); |
521 glFlush(); | 526 glFlush(); |
522 | 527 |
523 if (needs_resize_) { | 528 if (needs_resize_) { |
524 GpuHostMsg_AcceleratedSurfaceNew_Params params; | 529 GpuHostMsg_AcceleratedSurfaceNew_Params params; |
525 params.width = size_.width(); | 530 params.width = size_.width(); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 command_buffer_id, | 787 command_buffer_id, |
783 surface.get()); | 788 surface.get()); |
784 #endif | 789 #endif |
785 if (surface->Initialize()) | 790 if (surface->Initialize()) |
786 return surface; | 791 return surface; |
787 else | 792 else |
788 return NULL; | 793 return NULL; |
789 } | 794 } |
790 | 795 |
791 #endif // defined(USE_GPU) | 796 #endif // defined(USE_GPU) |
OLD | NEW |