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

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

Issue 2693023002: Use SwapBuffersWithBounds on Chromecast (Closed)
Patch Set: danakj nits Created 3 years, 9 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 | « components/display_compositor/compositor_overlay_candidate_validator_ozone.cc ('k') | no next file » | 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 if (frame.sub_buffer_rect) { 109 if (frame.sub_buffer_rect) {
110 reflector_texture_->CopyTextureSubImage(*frame.sub_buffer_rect); 110 reflector_texture_->CopyTextureSubImage(*frame.sub_buffer_rect);
111 reflector_->OnSourcePostSubBuffer(*frame.sub_buffer_rect, surface_size); 111 reflector_->OnSourcePostSubBuffer(*frame.sub_buffer_rect, surface_size);
112 } else { 112 } else {
113 reflector_texture_->CopyTextureFullImage(surface_size); 113 reflector_texture_->CopyTextureFullImage(surface_size);
114 reflector_->OnSourceSwapBuffers(surface_size); 114 reflector_->OnSourceSwapBuffers(surface_size);
115 } 115 }
116 } 116 }
117 117
118 if (frame.sub_buffer_rect) { 118 if (frame.sub_buffer_rect) {
119 DCHECK(frame.content_bounds.empty());
119 context_provider_->ContextSupport()->PartialSwapBuffers( 120 context_provider_->ContextSupport()->PartialSwapBuffers(
120 *frame.sub_buffer_rect); 121 *frame.sub_buffer_rect);
122 } else if (!frame.content_bounds.empty()) {
123 context_provider_->ContextSupport()->SwapWithBounds(frame.content_bounds);
121 } else { 124 } else {
122 context_provider_->ContextSupport()->Swap(); 125 context_provider_->ContextSupport()->Swap();
123 } 126 }
124 } 127 }
125 128
126 uint32_t GpuBrowserCompositorOutputSurface::GetFramebufferCopyTextureFormat() { 129 uint32_t GpuBrowserCompositorOutputSurface::GetFramebufferCopyTextureFormat() {
127 auto* gl = static_cast<ui::ContextProviderCommandBuffer*>(context_provider()); 130 auto* gl = static_cast<ui::ContextProviderCommandBuffer*>(context_provider());
128 return gl->GetCopyTextureInternalFormat(); 131 return gl->GetCopyTextureInternalFormat();
129 } 132 }
130 133
(...skipping 18 matching lines...) Expand all
149 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { 152 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() {
150 ui::ContextProviderCommandBuffer* provider_command_buffer = 153 ui::ContextProviderCommandBuffer* provider_command_buffer =
151 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); 154 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get());
152 gpu::CommandBufferProxyImpl* command_buffer_proxy = 155 gpu::CommandBufferProxyImpl* command_buffer_proxy =
153 provider_command_buffer->GetCommandBufferProxy(); 156 provider_command_buffer->GetCommandBufferProxy();
154 DCHECK(command_buffer_proxy); 157 DCHECK(command_buffer_proxy);
155 return command_buffer_proxy; 158 return command_buffer_proxy;
156 } 159 }
157 160
158 } // namespace content 161 } // namespace content
OLDNEW
« no previous file with comments | « components/display_compositor/compositor_overlay_candidate_validator_ozone.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698