OLD | NEW |
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 "cc/layers/texture_layer.h" | 5 #include "cc/layers/texture_layer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 is_lost_(false) {} | 251 is_lost_(false) {} |
252 | 252 |
253 TextureLayer::TextureMailboxHolder::~TextureMailboxHolder() { | 253 TextureLayer::TextureMailboxHolder::~TextureMailboxHolder() { |
254 DCHECK_EQ(0u, internal_references_); | 254 DCHECK_EQ(0u, internal_references_); |
255 } | 255 } |
256 | 256 |
257 std::unique_ptr<TextureLayer::TextureMailboxHolder::MainThreadReference> | 257 std::unique_ptr<TextureLayer::TextureMailboxHolder::MainThreadReference> |
258 TextureLayer::TextureMailboxHolder::Create( | 258 TextureLayer::TextureMailboxHolder::Create( |
259 const TextureMailbox& mailbox, | 259 const TextureMailbox& mailbox, |
260 std::unique_ptr<SingleReleaseCallback> release_callback) { | 260 std::unique_ptr<SingleReleaseCallback> release_callback) { |
261 return base::WrapUnique(new MainThreadReference( | 261 return base::MakeUnique<MainThreadReference>( |
262 new TextureMailboxHolder(mailbox, std::move(release_callback)))); | 262 new TextureMailboxHolder(mailbox, std::move(release_callback))); |
263 } | 263 } |
264 | 264 |
265 void TextureLayer::TextureMailboxHolder::Return( | 265 void TextureLayer::TextureMailboxHolder::Return( |
266 const gpu::SyncToken& sync_token, | 266 const gpu::SyncToken& sync_token, |
267 bool is_lost) { | 267 bool is_lost) { |
268 base::AutoLock lock(arguments_lock_); | 268 base::AutoLock lock(arguments_lock_); |
269 sync_token_ = sync_token; | 269 sync_token_ = sync_token; |
270 is_lost_ = is_lost; | 270 is_lost_ = is_lost; |
271 } | 271 } |
272 | 272 |
(...skipping 23 matching lines...) Expand all Loading... |
296 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( | 296 void TextureLayer::TextureMailboxHolder::ReturnAndReleaseOnImplThread( |
297 const gpu::SyncToken& sync_token, | 297 const gpu::SyncToken& sync_token, |
298 bool is_lost, | 298 bool is_lost, |
299 BlockingTaskRunner* main_thread_task_runner) { | 299 BlockingTaskRunner* main_thread_task_runner) { |
300 Return(sync_token, is_lost); | 300 Return(sync_token, is_lost); |
301 main_thread_task_runner->PostTask( | 301 main_thread_task_runner->PostTask( |
302 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); | 302 FROM_HERE, base::Bind(&TextureMailboxHolder::InternalRelease, this)); |
303 } | 303 } |
304 | 304 |
305 } // namespace cc | 305 } // namespace cc |
OLD | NEW |