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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { | 73 void GpuBrowserCompositorOutputSurface::OnReflectorChanged() { |
74 if (!reflector_) { | 74 if (!reflector_) { |
75 reflector_texture_.reset(); | 75 reflector_texture_.reset(); |
76 } else { | 76 } else { |
77 reflector_texture_.reset(new ReflectorTexture(context_provider())); | 77 reflector_texture_.reset(new ReflectorTexture(context_provider())); |
78 reflector_->OnSourceTextureMailboxUpdated(reflector_texture_->mailbox()); | 78 reflector_->OnSourceTextureMailboxUpdated(reflector_texture_->mailbox()); |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 void GpuBrowserCompositorOutputSurface::SwapBuffers( | 82 void GpuBrowserCompositorOutputSurface::SwapBuffers( |
83 cc::CompositorFrame* frame) { | 83 std::unique_ptr<cc::CompositorFrame> frame) { |
84 DCHECK(frame->gl_frame_data); | 84 DCHECK(frame->gl_frame_data); |
85 | 85 |
86 GetCommandBufferProxy()->SetLatencyInfo(frame->metadata.latency_info); | 86 GetCommandBufferProxy()->SetLatencyInfo(frame->metadata.latency_info); |
87 | 87 |
88 if (reflector_) { | 88 if (reflector_) { |
89 if (frame->gl_frame_data->sub_buffer_rect == | 89 if (frame->gl_frame_data->sub_buffer_rect == |
90 gfx::Rect(frame->gl_frame_data->size)) { | 90 gfx::Rect(frame->gl_frame_data->size)) { |
91 reflector_texture_->CopyTextureFullImage(SurfaceSize()); | 91 reflector_texture_->CopyTextureFullImage(SurfaceSize()); |
92 reflector_->OnSourceSwapBuffers(); | 92 reflector_->OnSourceSwapBuffers(); |
93 } else { | 93 } else { |
(...skipping 21 matching lines...) Expand all Loading... |
115 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); | 115 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info); |
116 OnSwapBuffersComplete(); | 116 OnSwapBuffersComplete(); |
117 } | 117 } |
118 | 118 |
119 #if defined(OS_MACOSX) | 119 #if defined(OS_MACOSX) |
120 void GpuBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( | 120 void GpuBrowserCompositorOutputSurface::SetSurfaceSuspendedForRecycle( |
121 bool suspended) {} | 121 bool suspended) {} |
122 #endif | 122 #endif |
123 | 123 |
124 } // namespace content | 124 } // namespace content |
OLD | NEW |