Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc

Issue 663363002: Standardize usage of virtual/override/final in gpu/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update generator script Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h" 5 #include "gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 public: 44 public:
45 TransferThread() 45 TransferThread()
46 : base::Thread(kAsyncTransferThreadName), 46 : base::Thread(kAsyncTransferThreadName),
47 initialized_(false) { 47 initialized_(false) {
48 Start(); 48 Start();
49 #if defined(OS_ANDROID) || defined(OS_LINUX) 49 #if defined(OS_ANDROID) || defined(OS_LINUX)
50 SetPriority(base::kThreadPriority_Background); 50 SetPriority(base::kThreadPriority_Background);
51 #endif 51 #endif
52 } 52 }
53 53
54 virtual ~TransferThread() { 54 ~TransferThread() override {
55 // The only instance of this class was declared leaky. 55 // The only instance of this class was declared leaky.
56 NOTREACHED(); 56 NOTREACHED();
57 } 57 }
58 58
59 void InitializeOnMainThread(gfx::GLContext* parent_context) { 59 void InitializeOnMainThread(gfx::GLContext* parent_context) {
60 TRACE_EVENT0("gpu", "TransferThread::InitializeOnMainThread"); 60 TRACE_EVENT0("gpu", "TransferThread::InitializeOnMainThread");
61 if (initialized_) 61 if (initialized_)
62 return; 62 return;
63 63
64 base::WaitableEvent wait_for_init(true, false); 64 base::WaitableEvent wait_for_init(true, false);
65 message_loop_proxy()->PostTask( 65 message_loop_proxy()->PostTask(
66 FROM_HERE, 66 FROM_HERE,
67 base::Bind(&TransferThread::InitializeOnTransferThread, 67 base::Bind(&TransferThread::InitializeOnTransferThread,
68 base::Unretained(this), 68 base::Unretained(this),
69 base::Unretained(parent_context), 69 base::Unretained(parent_context),
70 &wait_for_init)); 70 &wait_for_init));
71 wait_for_init.Wait(); 71 wait_for_init.Wait();
72 } 72 }
73 73
74 virtual void CleanUp() override { 74 void CleanUp() override {
75 surface_ = NULL; 75 surface_ = NULL;
76 context_ = NULL; 76 context_ = NULL;
77 } 77 }
78 78
79 private: 79 private:
80 bool initialized_; 80 bool initialized_;
81 81
82 scoped_refptr<gfx::GLSurface> surface_; 82 scoped_refptr<gfx::GLSurface> surface_;
83 scoped_refptr<gfx::GLContext> context_; 83 scoped_refptr<gfx::GLContext> context_;
84 84
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } // namespace 370 } // namespace
371 371
372 class AsyncPixelTransferDelegateShareGroup 372 class AsyncPixelTransferDelegateShareGroup
373 : public AsyncPixelTransferDelegate, 373 : public AsyncPixelTransferDelegate,
374 public base::SupportsWeakPtr<AsyncPixelTransferDelegateShareGroup> { 374 public base::SupportsWeakPtr<AsyncPixelTransferDelegateShareGroup> {
375 public: 375 public:
376 AsyncPixelTransferDelegateShareGroup( 376 AsyncPixelTransferDelegateShareGroup(
377 AsyncPixelTransferManagerShareGroup::SharedState* shared_state, 377 AsyncPixelTransferManagerShareGroup::SharedState* shared_state,
378 GLuint texture_id, 378 GLuint texture_id,
379 const AsyncTexImage2DParams& define_params); 379 const AsyncTexImage2DParams& define_params);
380 virtual ~AsyncPixelTransferDelegateShareGroup(); 380 ~AsyncPixelTransferDelegateShareGroup() override;
381 381
382 void BindTransfer() { state_->BindTransfer(); } 382 void BindTransfer() { state_->BindTransfer(); }
383 383
384 // Implement AsyncPixelTransferDelegate: 384 // Implement AsyncPixelTransferDelegate:
385 virtual void AsyncTexImage2D( 385 void AsyncTexImage2D(const AsyncTexImage2DParams& tex_params,
386 const AsyncTexImage2DParams& tex_params, 386 const AsyncMemoryParams& mem_params,
387 const AsyncMemoryParams& mem_params, 387 const base::Closure& bind_callback) override;
388 const base::Closure& bind_callback) override; 388 void AsyncTexSubImage2D(const AsyncTexSubImage2DParams& tex_params,
389 virtual void AsyncTexSubImage2D( 389 const AsyncMemoryParams& mem_params) override;
390 const AsyncTexSubImage2DParams& tex_params, 390 bool TransferIsInProgress() override;
391 const AsyncMemoryParams& mem_params) override; 391 void WaitForTransferCompletion() override;
392 virtual bool TransferIsInProgress() override;
393 virtual void WaitForTransferCompletion() override;
394 392
395 private: 393 private:
396 // A raw pointer is safe because the SharedState is owned by the Manager, 394 // A raw pointer is safe because the SharedState is owned by the Manager,
397 // which owns this Delegate. 395 // which owns this Delegate.
398 AsyncPixelTransferManagerShareGroup::SharedState* shared_state_; 396 AsyncPixelTransferManagerShareGroup::SharedState* shared_state_;
399 scoped_refptr<TransferStateInternal> state_; 397 scoped_refptr<TransferStateInternal> state_;
400 398
401 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateShareGroup); 399 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateShareGroup);
402 }; 400 };
403 401
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 544
547 AsyncPixelTransferDelegate* 545 AsyncPixelTransferDelegate*
548 AsyncPixelTransferManagerShareGroup::CreatePixelTransferDelegateImpl( 546 AsyncPixelTransferManagerShareGroup::CreatePixelTransferDelegateImpl(
549 gles2::TextureRef* ref, 547 gles2::TextureRef* ref,
550 const AsyncTexImage2DParams& define_params) { 548 const AsyncTexImage2DParams& define_params) {
551 return new AsyncPixelTransferDelegateShareGroup( 549 return new AsyncPixelTransferDelegateShareGroup(
552 &shared_state_, ref->service_id(), define_params); 550 &shared_state_, ref->service_id(), define_params);
553 } 551 }
554 552
555 } // namespace gpu 553 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698