| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 context_provider_->ContextSupport()->PartialSwapBuffers( | 92 context_provider_->ContextSupport()->PartialSwapBuffers( |
| 93 frame.gl_frame_data->sub_buffer_rect); | 93 frame.gl_frame_data->sub_buffer_rect); |
| 94 } | 94 } |
| 95 | 95 |
| 96 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); | 96 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); |
| 97 const GLuint64 fence_sync = gl->InsertFenceSyncCHROMIUM(); | 97 const GLuint64 fence_sync = gl->InsertFenceSyncCHROMIUM(); |
| 98 gl->ShallowFlushCHROMIUM(); | 98 gl->ShallowFlushCHROMIUM(); |
| 99 | 99 |
| 100 gpu::SyncToken sync_token; | 100 gpu::SyncToken sync_token; |
| 101 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); | 101 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); |
| 102 | |
| 103 client_->DidSwapBuffers(); | |
| 104 } | 102 } |
| 105 | 103 |
| 106 bool DirectOutputSurfaceOzone::BindToClient(cc::OutputSurfaceClient* client) { | 104 bool DirectOutputSurfaceOzone::BindToClient(cc::OutputSurfaceClient* client) { |
| 107 if (!cc::OutputSurface::BindToClient(client)) | 105 if (!cc::OutputSurface::BindToClient(client)) |
| 108 return false; | 106 return false; |
| 109 | 107 |
| 110 if (capabilities_.uses_default_gl_framebuffer) { | 108 if (capabilities_.uses_default_gl_framebuffer) { |
| 111 capabilities_.flipped_output_surface = | 109 capabilities_.flipped_output_surface = |
| 112 context_provider()->ContextCapabilities().flips_vertically; | 110 context_provider()->ContextCapabilities().flips_vertically; |
| 113 } | 111 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size, | 155 void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size, |
| 158 float scale_factor, | 156 float scale_factor, |
| 159 const gfx::ColorSpace& color_space, | 157 const gfx::ColorSpace& color_space, |
| 160 bool alpha) { | 158 bool alpha) { |
| 161 OutputSurface::Reshape(size, scale_factor, color_space, alpha); | 159 OutputSurface::Reshape(size, scale_factor, color_space, alpha); |
| 162 DCHECK(buffer_queue_); | 160 DCHECK(buffer_queue_); |
| 163 buffer_queue_->Reshape(SurfaceSize(), scale_factor, color_space); | 161 buffer_queue_->Reshape(SurfaceSize(), scale_factor, color_space); |
| 164 } | 162 } |
| 165 | 163 |
| 166 } // namespace ui | 164 } // namespace ui |
| OLD | NEW |