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

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

Issue 2693023002: Use SwapBuffersWithBounds on Chromecast (Closed)
Patch Set: Address danakj comments on PS1 Created 3 years, 10 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/output_surface_client.h" 10 #include "cc/output/output_surface_client.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 gfx::Size surface_size = frame.size; 100 gfx::Size surface_size = frame.size;
101 if (reflector_) { 101 if (reflector_) {
102 if (swap_rect == gfx::Rect(surface_size)) { 102 if (swap_rect == gfx::Rect(surface_size)) {
103 reflector_texture_->CopyTextureFullImage(surface_size); 103 reflector_texture_->CopyTextureFullImage(surface_size);
104 reflector_->OnSourceSwapBuffers(surface_size); 104 reflector_->OnSourceSwapBuffers(surface_size);
105 } else { 105 } else {
106 reflector_texture_->CopyTextureSubImage(swap_rect); 106 reflector_texture_->CopyTextureSubImage(swap_rect);
107 reflector_->OnSourcePostSubBuffer(swap_rect, surface_size); 107 reflector_->OnSourcePostSubBuffer(swap_rect, surface_size);
108 } 108 }
109 } 109 }
110 110
danakj 2017/02/16 18:54:19 this could DCHECK that we don't have both partial
halliwell 2017/02/23 18:01:47 Done (btw, empty swap can only happen here through
111 if (swap_rect == gfx::Rect(frame.size)) 111 if (swap_rect != gfx::Rect(frame.size))
112 context_provider_->ContextSupport()->PartialSwapBuffers(swap_rect);
113 else if (!frame.content_bounds.empty())
114 context_provider_->ContextSupport()->SwapWithBounds(frame.content_bounds);
115 else
112 context_provider_->ContextSupport()->Swap(); 116 context_provider_->ContextSupport()->Swap();
113 else
114 context_provider_->ContextSupport()->PartialSwapBuffers(swap_rect);
115 } 117 }
116 118
117 uint32_t GpuBrowserCompositorOutputSurface::GetFramebufferCopyTextureFormat() { 119 uint32_t GpuBrowserCompositorOutputSurface::GetFramebufferCopyTextureFormat() {
118 auto* gl = static_cast<ui::ContextProviderCommandBuffer*>(context_provider()); 120 auto* gl = static_cast<ui::ContextProviderCommandBuffer*>(context_provider());
119 return gl->GetCopyTextureInternalFormat(); 121 return gl->GetCopyTextureInternalFormat();
120 } 122 }
121 123
122 bool GpuBrowserCompositorOutputSurface::IsDisplayedAsOverlayPlane() const { 124 bool GpuBrowserCompositorOutputSurface::IsDisplayedAsOverlayPlane() const {
123 return false; 125 return false;
124 } 126 }
(...skipping 15 matching lines...) Expand all
140 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() { 142 GpuBrowserCompositorOutputSurface::GetCommandBufferProxy() {
141 ui::ContextProviderCommandBuffer* provider_command_buffer = 143 ui::ContextProviderCommandBuffer* provider_command_buffer =
142 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get()); 144 static_cast<ui::ContextProviderCommandBuffer*>(context_provider_.get());
143 gpu::CommandBufferProxyImpl* command_buffer_proxy = 145 gpu::CommandBufferProxyImpl* command_buffer_proxy =
144 provider_command_buffer->GetCommandBufferProxy(); 146 provider_command_buffer->GetCommandBufferProxy();
145 DCHECK(command_buffer_proxy); 147 DCHECK(command_buffer_proxy);
146 return command_buffer_proxy; 148 return command_buffer_proxy;
147 } 149 }
148 150
149 } // namespace content 151 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698