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

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

Issue 2797443003: Fix screen mirroring on Chrome OS (ReflectorTexture partial swap) (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | content/browser/compositor/reflector_texture.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/output_surface_client.h" 10 #include "cc/output/output_surface_client.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 context_provider()->ContextGL()->ResizeCHROMIUM( 101 context_provider()->ContextGL()->ResizeCHROMIUM(
102 size.width(), size.height(), device_scale_factor, has_alpha); 102 size.width(), size.height(), device_scale_factor, has_alpha);
103 } 103 }
104 104
105 void GpuBrowserCompositorOutputSurface::SwapBuffers( 105 void GpuBrowserCompositorOutputSurface::SwapBuffers(
106 cc::OutputSurfaceFrame frame) { 106 cc::OutputSurfaceFrame frame) {
107 GetCommandBufferProxy()->SetLatencyInfo(frame.latency_info); 107 GetCommandBufferProxy()->SetLatencyInfo(frame.latency_info);
108 108
109 gfx::Size surface_size = frame.size; 109 gfx::Size surface_size = frame.size;
110 if (reflector_) { 110 if (reflector_) {
111 if (frame.sub_buffer_rect) { 111 if (frame.sub_buffer_rect && reflector_texture_->is_texture_defined()) {
danakj 2017/04/03 19:30:56 Looks like this bool could live on this class here
112 reflector_texture_->CopyTextureSubImage(*frame.sub_buffer_rect); 112 reflector_texture_->CopyTextureSubImage(*frame.sub_buffer_rect);
113 reflector_->OnSourcePostSubBuffer(*frame.sub_buffer_rect, surface_size); 113 reflector_->OnSourcePostSubBuffer(*frame.sub_buffer_rect, surface_size);
114 } else { 114 } else {
115 reflector_texture_->CopyTextureFullImage(surface_size); 115 reflector_texture_->CopyTextureFullImage(surface_size);
116 reflector_->OnSourceSwapBuffers(surface_size); 116 reflector_->OnSourceSwapBuffers(surface_size);
117 } 117 }
118 } 118 }
119 119
120 set_draw_rectangle_for_frame_ = false; 120 set_draw_rectangle_for_frame_ = false;
121 121
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { 169 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() {
170 ui::ContextProviderCommandBuffer* provider_command_buffer = 170 ui::ContextProviderCommandBuffer* provider_command_buffer =
171 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); 171 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get());
172 gpu::CommandBufferProxyImpl* command_buffer_proxy = 172 gpu::CommandBufferProxyImpl* command_buffer_proxy =
173 provider_command_buffer->GetCommandBufferProxy(); 173 provider_command_buffer->GetCommandBufferProxy();
174 DCHECK(command_buffer_proxy); 174 DCHECK(command_buffer_proxy);
175 return command_buffer_proxy; 175 return command_buffer_proxy;
176 } 176 }
177 177
178 } // namespace content 178 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/compositor/reflector_texture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698