| 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_surfaceless_browser_compositor_output_s
urface.h" | 5 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s
urface.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "content/browser/compositor/buffer_queue.h" | 8 #include "content/browser/compositor/buffer_queue.h" |
| 9 #include "content/browser/compositor/reflector_impl.h" | 9 #include "content/browser/compositor/reflector_impl.h" |
| 10 #include "content/browser/gpu/gpu_surface_tracker.h" | 10 #include "content/browser/gpu/gpu_surface_tracker.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 } | 31 } |
| 32 | 32 |
| 33 GpuSurfacelessBrowserCompositorOutputSurface:: | 33 GpuSurfacelessBrowserCompositorOutputSurface:: |
| 34 ~GpuSurfacelessBrowserCompositorOutputSurface() { | 34 ~GpuSurfacelessBrowserCompositorOutputSurface() { |
| 35 } | 35 } |
| 36 | 36 |
| 37 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers( | 37 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers( |
| 38 cc::CompositorFrame* frame) { | 38 cc::CompositorFrame* frame) { |
| 39 DCHECK(output_surface_); | 39 DCHECK(output_surface_); |
| 40 | 40 |
| 41 output_surface_->SwapBuffers(frame->gl_frame_data->sub_buffer_rect); |
| 42 |
| 41 const gfx::Size& size = frame->gl_frame_data->size; | 43 const gfx::Size& size = frame->gl_frame_data->size; |
| 42 context_provider_->ContextGL()->ScheduleOverlayPlaneCHROMIUM( | 44 context_provider_->ContextGL()->ScheduleOverlayPlaneCHROMIUM( |
| 43 0, | 45 0, |
| 44 GL_OVERLAY_TRANSFORM_NONE_CHROMIUM, | 46 GL_OVERLAY_TRANSFORM_NONE_CHROMIUM, |
| 45 output_surface_->current_texture_id(), | 47 output_surface_->current_texture_id(), |
| 46 0, | 48 0, |
| 47 0, | 49 0, |
| 48 size.width(), | 50 size.width(), |
| 49 size.height(), | 51 size.height(), |
| 50 0, | 52 0, |
| 51 0, | 53 0, |
| 52 1.0f, | 54 1.0f, |
| 53 1.0f); | 55 1.0f); |
| 54 output_surface_->SwapBuffers(); | |
| 55 GpuBrowserCompositorOutputSurface::SwapBuffers(frame); | 56 GpuBrowserCompositorOutputSurface::SwapBuffers(frame); |
| 56 } | 57 } |
| 57 | 58 |
| 58 void GpuSurfacelessBrowserCompositorOutputSurface::OnSwapBuffersComplete() { | 59 void GpuSurfacelessBrowserCompositorOutputSurface::OnSwapBuffersComplete() { |
| 59 DCHECK(output_surface_); | 60 DCHECK(output_surface_); |
| 60 output_surface_->PageFlipComplete(); | 61 output_surface_->PageFlipComplete(); |
| 61 GpuBrowserCompositorOutputSurface::OnSwapBuffersComplete(); | 62 GpuBrowserCompositorOutputSurface::OnSwapBuffersComplete(); |
| 62 } | 63 } |
| 63 | 64 |
| 64 void GpuSurfacelessBrowserCompositorOutputSurface::BindFramebuffer() { | 65 void GpuSurfacelessBrowserCompositorOutputSurface::BindFramebuffer() { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 76 | 77 |
| 77 bool GpuSurfacelessBrowserCompositorOutputSurface::BindToClient( | 78 bool GpuSurfacelessBrowserCompositorOutputSurface::BindToClient( |
| 78 cc::OutputSurfaceClient* client) { | 79 cc::OutputSurfaceClient* client) { |
| 79 if (!GpuBrowserCompositorOutputSurface::BindToClient(client)) | 80 if (!GpuBrowserCompositorOutputSurface::BindToClient(client)) |
| 80 return false; | 81 return false; |
| 81 output_surface_.reset(new BufferQueue(context_provider_, internalformat_)); | 82 output_surface_.reset(new BufferQueue(context_provider_, internalformat_)); |
| 82 return output_surface_->Initialize(); | 83 return output_surface_->Initialize(); |
| 83 } | 84 } |
| 84 | 85 |
| 85 } // namespace content | 86 } // namespace content |
| OLD | NEW |