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/browser_compositor_overlay_candidate_valida
tor.h" | 8 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida
tor.h" |
9 #include "content/browser/compositor/buffer_queue.h" | 9 #include "content/browser/compositor/buffer_queue.h" |
10 #include "content/browser/compositor/reflector_impl.h" | 10 #include "content/browser/compositor/reflector_impl.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 output_surface_.reset(new BufferQueue( | 49 output_surface_.reset(new BufferQueue( |
50 context_provider_, target, internalformat_, gl_helper_.get(), | 50 context_provider_, target, internalformat_, gl_helper_.get(), |
51 gpu_memory_buffer_manager_, surface_id)); | 51 gpu_memory_buffer_manager_, surface_id)); |
52 output_surface_->Initialize(); | 52 output_surface_->Initialize(); |
53 } | 53 } |
54 | 54 |
55 GpuSurfacelessBrowserCompositorOutputSurface:: | 55 GpuSurfacelessBrowserCompositorOutputSurface:: |
56 ~GpuSurfacelessBrowserCompositorOutputSurface() { | 56 ~GpuSurfacelessBrowserCompositorOutputSurface() { |
57 } | 57 } |
58 | 58 |
| 59 unsigned GpuSurfacelessBrowserCompositorOutputSurface::GetOverlayTextureId() |
| 60 const { |
| 61 return output_surface_->current_texture_id(); |
| 62 } |
| 63 |
59 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers( | 64 void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers( |
60 cc::CompositorFrame* frame) { | 65 cc::CompositorFrame* frame) { |
61 DCHECK(output_surface_); | 66 DCHECK(output_surface_); |
62 | 67 |
63 GLuint texture = output_surface_->current_texture_id(); | 68 GLuint texture = output_surface_->current_texture_id(); |
64 output_surface_->SwapBuffers(frame->gl_frame_data->sub_buffer_rect); | 69 output_surface_->SwapBuffers(frame->gl_frame_data->sub_buffer_rect); |
65 const gfx::Size& size = frame->gl_frame_data->size; | 70 const gfx::Size& size = frame->gl_frame_data->size; |
66 context_provider_->ContextGL()->ScheduleOverlayPlaneCHROMIUM( | 71 context_provider_->ContextGL()->ScheduleOverlayPlaneCHROMIUM( |
67 0, | 72 0, |
68 GL_OVERLAY_TRANSFORM_NONE_CHROMIUM, | 73 GL_OVERLAY_TRANSFORM_NONE_CHROMIUM, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 #endif | 119 #endif |
115 } | 120 } |
116 | 121 |
117 #if defined(OS_MACOSX) | 122 #if defined(OS_MACOSX) |
118 void GpuSurfacelessBrowserCompositorOutputSurface::OnSurfaceDisplayed() { | 123 void GpuSurfacelessBrowserCompositorOutputSurface::OnSurfaceDisplayed() { |
119 OnSwapBuffersComplete(); | 124 OnSwapBuffersComplete(); |
120 } | 125 } |
121 #endif | 126 #endif |
122 | 127 |
123 } // namespace content | 128 } // namespace content |
OLD | NEW |