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

Side by Side Diff: cc/test/fake_context_provider.cc

Issue 61553006: Rename WebKit namespace to blink (part 5) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « cc/scheduler/texture_uploader_unittest.cc ('k') | cc/test/fake_web_graphics_context_3d.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "cc/test/fake_context_provider.h" 5 #include "cc/test/fake_context_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "cc/test/test_web_graphics_context_3d.h" 8 #include "cc/test/test_web_graphics_context_3d.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool FakeContextProvider::BindToCurrentThread() { 71 bool FakeContextProvider::BindToCurrentThread() {
72 bound_ = true; 72 bound_ = true;
73 if (!context3d_->makeContextCurrent()) { 73 if (!context3d_->makeContextCurrent()) {
74 base::AutoLock lock(destroyed_lock_); 74 base::AutoLock lock(destroyed_lock_);
75 destroyed_ = true; 75 destroyed_ = true;
76 return false; 76 return false;
77 } 77 }
78 return true; 78 return true;
79 } 79 }
80 80
81 WebKit::WebGraphicsContext3D* FakeContextProvider::Context3d() { 81 blink::WebGraphicsContext3D* FakeContextProvider::Context3d() {
82 DCHECK(context3d_); 82 DCHECK(context3d_);
83 DCHECK(bound_); 83 DCHECK(bound_);
84 84
85 return context3d_.get(); 85 return context3d_.get();
86 } 86 }
87 class GrContext* FakeContextProvider::GrContext() { 87 class GrContext* FakeContextProvider::GrContext() {
88 DCHECK(context3d_); 88 DCHECK(context3d_);
89 DCHECK(bound_); 89 DCHECK(bound_);
90 90
91 // TODO(danakj): Make a fake GrContext. 91 // TODO(danakj): Make a fake GrContext.
92 return NULL; 92 return NULL;
93 } 93 }
94 94
95 void FakeContextProvider::VerifyContexts() { 95 void FakeContextProvider::VerifyContexts() {
96 DCHECK(context3d_); 96 DCHECK(context3d_);
97 DCHECK(bound_); 97 DCHECK(bound_);
98 98
99 if (context3d_->isContextLost()) { 99 if (context3d_->isContextLost()) {
100 base::AutoLock lock(destroyed_lock_); 100 base::AutoLock lock(destroyed_lock_);
101 destroyed_ = true; 101 destroyed_ = true;
102 } 102 }
103 } 103 }
104 104
105 bool FakeContextProvider::DestroyedOnMainThread() { 105 bool FakeContextProvider::DestroyedOnMainThread() {
106 base::AutoLock lock(destroyed_lock_); 106 base::AutoLock lock(destroyed_lock_);
107 return destroyed_; 107 return destroyed_;
108 } 108 }
109 109
110 } // namespace cc 110 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/texture_uploader_unittest.cc ('k') | cc/test/fake_web_graphics_context_3d.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698