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

Side by Side Diff: content/renderer/gpu/command_buffer_proxy.cc

Issue 9192014: Replace WGC3D visibility extension with resource_usage extension. [Part 2 of 3] (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added image_transport_surface_win changes Created 8 years, 11 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 | « content/renderer/gpu/command_buffer_proxy.h ('k') | content/renderer/gpu/renderer_gl_context.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/renderer/gpu/command_buffer_proxy.h" 5 #include "content/renderer/gpu/command_buffer_proxy.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 323
324 if (!Send(new GpuChannelMsg_Echo(GpuCommandBufferMsg_EchoAck(route_id_)))) { 324 if (!Send(new GpuChannelMsg_Echo(GpuCommandBufferMsg_EchoAck(route_id_)))) {
325 return false; 325 return false;
326 } 326 }
327 327
328 echo_tasks_.push(callback); 328 echo_tasks_.push(callback);
329 329
330 return true; 330 return true;
331 } 331 }
332 332
333 bool CommandBufferProxy::SetSurfaceVisible(bool visible) { 333 bool CommandBufferProxy::SetResourceUsage(
334 if (last_state_.error != gpu::error::kNoError) { 334 gfx::GLSurface::ResourceUsage resourceUsage) {
335 if (last_state_.error != gpu::error::kNoError)
335 return false; 336 return false;
336 }
337 337
338 return Send(new GpuCommandBufferMsg_SetSurfaceVisible(route_id_, visible)); 338 return Send(new GpuCommandBufferMsg_SetResourceUsage(
339 route_id_, resourceUsage));
339 } 340 }
340 341
341 342
342 bool CommandBufferProxy::SetParent(CommandBufferProxy* parent_command_buffer, 343 bool CommandBufferProxy::SetParent(CommandBufferProxy* parent_command_buffer,
343 uint32 parent_texture_id) { 344 uint32 parent_texture_id) {
344 if (last_state_.error != gpu::error::kNoError) 345 if (last_state_.error != gpu::error::kNoError)
345 return false; 346 return false;
346 347
347 bool result; 348 bool result;
348 if (parent_command_buffer) { 349 if (parent_command_buffer) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 delete msg; 414 delete msg;
414 return false; 415 return false;
415 } 416 }
416 417
417 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { 418 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) {
418 // Handle wraparound. It works as long as we don't have more than 2B state 419 // Handle wraparound. It works as long as we don't have more than 2B state
419 // updates in flight across which reordering occurs. 420 // updates in flight across which reordering occurs.
420 if (state.generation - last_state_.generation < 0x80000000U) 421 if (state.generation - last_state_.generation < 0x80000000U)
421 last_state_ = state; 422 last_state_ = state;
422 } 423 }
OLDNEW
« no previous file with comments | « content/renderer/gpu/command_buffer_proxy.h ('k') | content/renderer/gpu/renderer_gl_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698