| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/ui/surfaces/direct_output_surface_ozone.h" | 5 #include "services/ui/surfaces/direct_output_surface_ozone.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 buffer_queue_->SwapBuffers(frame.sub_buffer_rect); | 105 buffer_queue_->SwapBuffers(frame.sub_buffer_rect); |
| 106 | 106 |
| 107 // Code combining GpuBrowserCompositorOutputSurface + DirectOutputSurface | 107 // Code combining GpuBrowserCompositorOutputSurface + DirectOutputSurface |
| 108 if (frame.sub_buffer_rect == gfx::Rect(frame.size)) { | 108 if (frame.sub_buffer_rect == gfx::Rect(frame.size)) { |
| 109 context_provider_->ContextSupport()->Swap(); | 109 context_provider_->ContextSupport()->Swap(); |
| 110 } else { | 110 } else { |
| 111 context_provider_->ContextSupport()->PartialSwapBuffers( | 111 context_provider_->ContextSupport()->PartialSwapBuffers( |
| 112 frame.sub_buffer_rect); | 112 frame.sub_buffer_rect); |
| 113 } | 113 } |
| 114 | |
| 115 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); | |
| 116 const GLuint64 fence_sync = gl->InsertFenceSyncCHROMIUM(); | |
| 117 gl->ShallowFlushCHROMIUM(); | |
| 118 | |
| 119 gpu::SyncToken sync_token; | |
| 120 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); | |
| 121 } | 114 } |
| 122 | 115 |
| 123 uint32_t DirectOutputSurfaceOzone::GetFramebufferCopyTextureFormat() { | 116 uint32_t DirectOutputSurfaceOzone::GetFramebufferCopyTextureFormat() { |
| 124 return buffer_queue_->internal_format(); | 117 return buffer_queue_->internal_format(); |
| 125 } | 118 } |
| 126 | 119 |
| 127 cc::OverlayCandidateValidator* | 120 cc::OverlayCandidateValidator* |
| 128 DirectOutputSurfaceOzone::GetOverlayCandidateValidator() const { | 121 DirectOutputSurfaceOzone::GetOverlayCandidateValidator() const { |
| 129 return nullptr; | 122 return nullptr; |
| 130 } | 123 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 160 } |
| 168 | 161 |
| 169 buffer_queue_->PageFlipComplete(); | 162 buffer_queue_->PageFlipComplete(); |
| 170 client_->DidReceiveSwapBuffersAck(); | 163 client_->DidReceiveSwapBuffersAck(); |
| 171 | 164 |
| 172 if (force_swap) | 165 if (force_swap) |
| 173 client_->SetNeedsRedrawRect(gfx::Rect(swap_size_)); | 166 client_->SetNeedsRedrawRect(gfx::Rect(swap_size_)); |
| 174 } | 167 } |
| 175 | 168 |
| 176 } // namespace ui | 169 } // namespace ui |
| OLD | NEW |