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

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

Issue 944053004: OffscreenPreRaster and its plumbings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 5 years, 10 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 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/public/browser/draw_gl.h" 8 #include "android_webview/public/browser/draw_gl.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 FROM_HERE, 113 FROM_HERE,
114 base::Bind(&FakeWindow::OnDrawHardware, weak_ptr_factory_.GetWeakPtr())); 114 base::Bind(&FakeWindow::OnDrawHardware, weak_ptr_factory_.GetWeakPtr()));
115 } 115 }
116 116
117 void FakeWindow::OnDrawHardware() { 117 void FakeWindow::OnDrawHardware() {
118 CheckCurrentlyOnUIThread(); 118 CheckCurrentlyOnUIThread();
119 DCHECK(on_draw_hardware_pending_); 119 DCHECK(on_draw_hardware_pending_);
120 on_draw_hardware_pending_ = false; 120 on_draw_hardware_pending_ = false;
121 121
122 hooks_->WillOnDraw(); 122 hooks_->WillOnDraw();
123 view_->PrepareToDraw(gfx::Vector2d(), location_);
123 bool success = view_->OnDrawHardware(); 124 bool success = view_->OnDrawHardware();
124 hooks_->DidOnDraw(success); 125 hooks_->DidOnDraw(success);
125 if (success) { 126 if (success) {
126 CreateRenderThreadIfNeeded(); 127 CreateRenderThreadIfNeeded();
127 128
128 base::WaitableEvent completion(true, false); 129 base::WaitableEvent completion(true, false);
129 render_thread_loop_->PostTask( 130 render_thread_loop_->PostTask(
130 FROM_HERE, base::Bind(&FakeWindow::DrawFunctorOnRT, 131 FROM_HERE, base::Bind(&FakeWindow::DrawFunctorOnRT,
131 base::Unretained(this), &completion)); 132 base::Unretained(this), &completion));
132 completion.Wait(); 133 completion.Wait();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 surface_ = nullptr; 231 surface_ = nullptr;
231 } 232 }
232 sync->Signal(); 233 sync->Signal();
233 } 234 }
234 235
235 void FakeWindow::CheckCurrentlyOnRT() { 236 void FakeWindow::CheckCurrentlyOnRT() {
236 DCHECK(rt_checker_.CalledOnValidSequencedThread()); 237 DCHECK(rt_checker_.CalledOnValidSequencedThread());
237 } 238 }
238 239
239 } // namespace android_webview 240 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698