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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 10729002: Fix latency tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove expect that no longer works Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | ui/gl/gl_surface_glx.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 delayed_work_scheduled_ = true; 199 delayed_work_scheduled_ = true;
200 MessageLoop::current()->PostDelayedTask( 200 MessageLoop::current()->PostDelayedTask(
201 FROM_HERE, 201 FROM_HERE,
202 base::Bind(&GpuCommandBufferStub::PollWork, 202 base::Bind(&GpuCommandBufferStub::PollWork,
203 AsWeakPtr()), 203 AsWeakPtr()),
204 base::TimeDelta::FromMilliseconds(delay)); 204 base::TimeDelta::FromMilliseconds(delay));
205 } 205 }
206 } 206 }
207 207
208 void GpuCommandBufferStub::OnEcho(const IPC::Message& message) { 208 void GpuCommandBufferStub::OnEcho(const IPC::Message& message) {
209 // For latency_tests.cc:
210 UNSHIPPED_TRACE_EVENT_INSTANT0("test_gpu", "CompositorSwapBuffersComplete");
211 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho"); 209 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnEcho");
212 Send(new IPC::Message(message)); 210 Send(new IPC::Message(message));
213 } 211 }
214 212
215 void GpuCommandBufferStub::DelayEcho(IPC::Message* message) { 213 void GpuCommandBufferStub::DelayEcho(IPC::Message* message) {
216 delayed_echos_.push_back(message); 214 delayed_echos_.push_back(message);
217 } 215 }
218 216
219 void GpuCommandBufferStub::OnReschedule() { 217 void GpuCommandBufferStub::OnReschedule() {
220 if (!IsScheduled()) 218 if (!IsScheduled())
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 const GpuMemoryAllocation& allocation) { 767 const GpuMemoryAllocation& allocation) {
770 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); 768 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation));
771 // This can be called outside of OnMessageReceived, so the context needs to be 769 // This can be called outside of OnMessageReceived, so the context needs to be
772 // made current before calling methods on the surface. 770 // made current before calling methods on the surface.
773 if (!surface_ || !MakeCurrent()) 771 if (!surface_ || !MakeCurrent())
774 return; 772 return;
775 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); 773 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer);
776 } 774 }
777 775
778 #endif // defined(ENABLE_GPU) 776 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | ui/gl/gl_surface_glx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698