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 "services/ui/surfaces/direct_output_surface.h" | 5 #include "services/ui/surfaces/direct_output_surface.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); | 62 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); |
63 const GLuint64 fence_sync = gl->InsertFenceSyncCHROMIUM(); | 63 const GLuint64 fence_sync = gl->InsertFenceSyncCHROMIUM(); |
64 gl->ShallowFlushCHROMIUM(); | 64 gl->ShallowFlushCHROMIUM(); |
65 | 65 |
66 gpu::SyncToken sync_token; | 66 gpu::SyncToken sync_token; |
67 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); | 67 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); |
68 | 68 |
69 context_provider_->ContextSupport()->SignalSyncToken( | 69 context_provider_->ContextSupport()->SignalSyncToken( |
70 sync_token, base::Bind(&OutputSurface::OnSwapBuffersComplete, | 70 sync_token, base::Bind(&OutputSurface::OnSwapBuffersComplete, |
71 weak_ptr_factory_.GetWeakPtr())); | 71 weak_ptr_factory_.GetWeakPtr())); |
72 client_->DidSwapBuffers(); | |
73 } | 72 } |
74 | 73 |
75 uint32_t DirectOutputSurface::GetFramebufferCopyTextureFormat() { | 74 uint32_t DirectOutputSurface::GetFramebufferCopyTextureFormat() { |
76 // TODO(danakj): What attributes are used for the default framebuffer here? | 75 // TODO(danakj): What attributes are used for the default framebuffer here? |
77 // Can it have alpha? SurfacesContextProvider doesn't take any attributes. | 76 // Can it have alpha? SurfacesContextProvider doesn't take any attributes. |
78 return GL_RGB; | 77 return GL_RGB; |
79 } | 78 } |
80 | 79 |
81 } // namespace ui | 80 } // namespace ui |
OLD | NEW |