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 "ui/compositor/test/in_process_context_factory.h" | 5 #include "ui/compositor/test/in_process_context_factory.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); | 78 gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); |
79 const uint64_t fence_sync = gl->InsertFenceSyncCHROMIUM(); | 79 const uint64_t fence_sync = gl->InsertFenceSyncCHROMIUM(); |
80 gl->ShallowFlushCHROMIUM(); | 80 gl->ShallowFlushCHROMIUM(); |
81 | 81 |
82 gpu::SyncToken sync_token; | 82 gpu::SyncToken sync_token; |
83 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); | 83 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData()); |
84 | 84 |
85 context_provider_->ContextSupport()->SignalSyncToken( | 85 context_provider_->ContextSupport()->SignalSyncToken( |
86 sync_token, base::Bind(&OutputSurface::OnSwapBuffersComplete, | 86 sync_token, base::Bind(&OutputSurface::OnSwapBuffersComplete, |
87 weak_ptr_factory_.GetWeakPtr())); | 87 weak_ptr_factory_.GetWeakPtr())); |
88 client_->DidSwapBuffers(); | |
89 } | 88 } |
90 uint32_t GetFramebufferCopyTextureFormat() override { | 89 uint32_t GetFramebufferCopyTextureFormat() override { |
91 auto* gl = static_cast<InProcessContextProvider*>(context_provider()); | 90 auto* gl = static_cast<InProcessContextProvider*>(context_provider()); |
92 return gl->GetCopyTextureInternalFormat(); | 91 return gl->GetCopyTextureInternalFormat(); |
93 } | 92 } |
94 | 93 |
95 private: | 94 private: |
96 base::WeakPtrFactory<DirectOutputSurface> weak_ptr_factory_; | 95 base::WeakPtrFactory<DirectOutputSurface> weak_ptr_factory_; |
97 | 96 |
98 DISALLOW_COPY_AND_ASSIGN(DirectOutputSurface); | 97 DISALLOW_COPY_AND_ASSIGN(DirectOutputSurface); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 270 |
272 void InProcessContextFactory::AddObserver(ContextFactoryObserver* observer) { | 271 void InProcessContextFactory::AddObserver(ContextFactoryObserver* observer) { |
273 observer_list_.AddObserver(observer); | 272 observer_list_.AddObserver(observer); |
274 } | 273 } |
275 | 274 |
276 void InProcessContextFactory::RemoveObserver(ContextFactoryObserver* observer) { | 275 void InProcessContextFactory::RemoveObserver(ContextFactoryObserver* observer) { |
277 observer_list_.RemoveObserver(observer); | 276 observer_list_.RemoveObserver(observer); |
278 } | 277 } |
279 | 278 |
280 } // namespace ui | 279 } // namespace ui |
OLD | NEW |