Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: content/browser/compositor/gpu_browser_compositor_output_surface.cc

Issue 2096493002: Make cc::CompositorFrames movable [Part 1 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix reflector Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698