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

Side by Side Diff: android_webview/browser/test/fake_window.cc

Issue 1998723002: Move code in ui/gl/* from gfx:: to gl:: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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
« no previous file with comments | « android_webview/browser/test/fake_window.h ('k') | android_webview/lib/main/webview_tests.cc » ('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 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 "android_webview/browser/test/fake_window.h" 5 #include "android_webview/browser/test/fake_window.h"
6 6
7 #include "android_webview/browser/browser_view_renderer.h" 7 #include "android_webview/browser/browser_view_renderer.h"
8 #include "android_webview/browser/child_frame.h" 8 #include "android_webview/browser/child_frame.h"
9 #include "android_webview/browser/render_thread_manager.h" 9 #include "android_webview/browser/render_thread_manager.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 FROM_HERE, base::Bind(&FakeWindow::InitializeOnRT, base::Unretained(this), 174 FROM_HERE, base::Bind(&FakeWindow::InitializeOnRT, base::Unretained(this),
175 &completion)); 175 &completion));
176 completion.Wait(); 176 completion.Wait();
177 } 177 }
178 178
179 void FakeWindow::InitializeOnRT(base::WaitableEvent* sync) { 179 void FakeWindow::InitializeOnRT(base::WaitableEvent* sync) {
180 CheckCurrentlyOnRT(); 180 CheckCurrentlyOnRT();
181 surface_ = gl::init::CreateOffscreenGLSurface(surface_size_); 181 surface_ = gl::init::CreateOffscreenGLSurface(surface_size_);
182 DCHECK(surface_); 182 DCHECK(surface_);
183 DCHECK(surface_->GetHandle()); 183 DCHECK(surface_->GetHandle());
184 context_ = gl::init::CreateGLContext(nullptr, surface_.get(), 184 context_ =
185 gfx::PreferDiscreteGpu); 185 gl::init::CreateGLContext(nullptr, surface_.get(), gl::PreferDiscreteGpu);
186 DCHECK(context_); 186 DCHECK(context_);
187 sync->Signal(); 187 sync->Signal();
188 } 188 }
189 189
190 void FakeWindow::DestroyOnRT(base::WaitableEvent* sync) { 190 void FakeWindow::DestroyOnRT(base::WaitableEvent* sync) {
191 CheckCurrentlyOnRT(); 191 CheckCurrentlyOnRT();
192 if (context_) { 192 if (context_) {
193 DCHECK(!context_->IsCurrent(surface_.get())); 193 DCHECK(!context_->IsCurrent(surface_.get()));
194 context_ = nullptr; 194 context_ = nullptr;
195 surface_ = nullptr; 195 surface_ = nullptr;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 bool FakeFunctor::RequestInvokeGL(bool wait_for_completion) { 261 bool FakeFunctor::RequestInvokeGL(bool wait_for_completion) {
262 DCHECK(window_); 262 DCHECK(window_);
263 window_->RequestInvokeGL(this, wait_for_completion); 263 window_->RequestInvokeGL(this, wait_for_completion);
264 return true; 264 return true;
265 } 265 }
266 266
267 void FakeFunctor::DetachFunctorFromView() {} 267 void FakeFunctor::DetachFunctorFromView() {}
268 268
269 } // namespace android_webview 269 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/test/fake_window.h ('k') | android_webview/lib/main/webview_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698