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/output_surface_client.h" | 10 #include "cc/output/output_surface_client.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (reflector_) { | 98 if (reflector_) { |
99 if (swap_rect == gfx::Rect(surface_size)) { | 99 if (swap_rect == gfx::Rect(surface_size)) { |
100 reflector_texture_->CopyTextureFullImage(surface_size); | 100 reflector_texture_->CopyTextureFullImage(surface_size); |
101 reflector_->OnSourceSwapBuffers(surface_size); | 101 reflector_->OnSourceSwapBuffers(surface_size); |
102 } else { | 102 } else { |
103 reflector_texture_->CopyTextureSubImage(swap_rect); | 103 reflector_texture_->CopyTextureSubImage(swap_rect); |
104 reflector_->OnSourcePostSubBuffer(swap_rect, surface_size); | 104 reflector_->OnSourcePostSubBuffer(swap_rect, surface_size); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 if (swap_rect == gfx::Rect(frame.size)) | 108 if (frame.swap_with_damage_rect != gfx::Rect(frame.size)) |
| 109 context_provider_->ContextSupport()->SwapWithDamage( |
| 110 frame.swap_with_damage_rect); |
| 111 else if (swap_rect == gfx::Rect(frame.size)) |
109 context_provider_->ContextSupport()->Swap(); | 112 context_provider_->ContextSupport()->Swap(); |
110 else | 113 else |
111 context_provider_->ContextSupport()->PartialSwapBuffers(swap_rect); | 114 context_provider_->ContextSupport()->PartialSwapBuffers(swap_rect); |
112 } | 115 } |
113 | 116 |
114 uint32_t GpuBrowserCompositorOutputSurface::GetFramebufferCopyTextureFormat() { | 117 uint32_t GpuBrowserCompositorOutputSurface::GetFramebufferCopyTextureFormat() { |
115 auto* gl = static_cast<ContextProviderCommandBuffer*>(context_provider()); | 118 auto* gl = static_cast<ContextProviderCommandBuffer*>(context_provider()); |
116 return gl->GetCopyTextureInternalFormat(); | 119 return gl->GetCopyTextureInternalFormat(); |
117 } | 120 } |
118 | 121 |
(...skipping 19 matching lines...) Expand all Loading... |
138 ContextProviderCommandBuffer* provider_command_buffer = | 141 ContextProviderCommandBuffer* provider_command_buffer = |
139 static_cast<content::ContextProviderCommandBuffer*>( | 142 static_cast<content::ContextProviderCommandBuffer*>( |
140 context_provider_.get()); | 143 context_provider_.get()); |
141 gpu::CommandBufferProxyImpl* command_buffer_proxy = | 144 gpu::CommandBufferProxyImpl* command_buffer_proxy = |
142 provider_command_buffer->GetCommandBufferProxy(); | 145 provider_command_buffer->GetCommandBufferProxy(); |
143 DCHECK(command_buffer_proxy); | 146 DCHECK(command_buffer_proxy); |
144 return command_buffer_proxy; | 147 return command_buffer_proxy; |
145 } | 148 } |
146 | 149 |
147 } // namespace content | 150 } // namespace content |
OLD | NEW |