| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/compositor/gpu_browser_compositor_output_surface.h" | 5 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "content/browser/compositor/reflector_impl.h" | 8 #include "content/browser/compositor/reflector_impl.h" |
| 9 #include "content/common/gpu/client/context_provider_command_buffer.h" | 9 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 10 #include "gpu/command_buffer/client/gles2_interface.h" | 10 #include "gpu/command_buffer/client/gles2_interface.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 if (frame->gl_frame_data->sub_buffer_rect == | 41 if (frame->gl_frame_data->sub_buffer_rect == |
| 42 gfx::Rect(frame->gl_frame_data->size)) | 42 gfx::Rect(frame->gl_frame_data->size)) |
| 43 reflector_->OnSwapBuffers(); | 43 reflector_->OnSwapBuffers(); |
| 44 else | 44 else |
| 45 reflector_->OnPostSubBuffer(frame->gl_frame_data->sub_buffer_rect); | 45 reflector_->OnPostSubBuffer(frame->gl_frame_data->sub_buffer_rect); |
| 46 } | 46 } |
| 47 | 47 |
| 48 OutputSurface::SwapBuffers(frame); | 48 OutputSurface::SwapBuffers(frame); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void GpuBrowserCompositorOutputSurface::OnSwapBuffersComplete() { |
| 52 // On Mac, delay acknowledging the swap to the output surface client until |
| 53 // it has been drawn. |
| 54 #if !defined(OS_MACOSX) |
| 55 cc::OutputSurface::OnSwapBuffersComplete(); |
| 56 #endif |
| 57 } |
| 58 |
| 59 #if defined(OS_MACOSX) |
| 60 void GpuBrowserCompositorOutputSurface::OnSurfaceDisplayed() { |
| 61 cc::OutputSurface::OnSwapBuffersComplete(); |
| 62 } |
| 63 #endif |
| 64 |
| 51 } // namespace content | 65 } // namespace content |
| OLD | NEW |