OLD | NEW |
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 #include "content/common/gpu/client/command_buffer_proxy.h" | 5 #include "content/common/gpu/client/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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 if (!shared_memory->Map(size)) { | 308 if (!shared_memory->Map(size)) { |
309 delete shared_memory; | 309 delete shared_memory; |
310 return Buffer(); | 310 return Buffer(); |
311 } | 311 } |
312 } | 312 } |
313 | 313 |
314 Buffer buffer; | 314 Buffer buffer; |
315 buffer.ptr = shared_memory->memory(); | 315 buffer.ptr = shared_memory->memory(); |
316 buffer.size = size; | 316 buffer.size = size; |
317 buffer.shared_memory = shared_memory; | 317 buffer.shared_memory = shared_memory; |
318 // todo(apatrick,nfullagar): re-enable when cache sync issues are solved. | |
319 // see: http://code.google.com/p/chromium/issues/detail?id=116285 | |
320 #define DISABLE_TRANSFER_BUFFER_CACHE | |
321 #ifndef DISABLE_TRANSFER_BUFFER_CACHE | |
322 transfer_buffers_[id] = buffer; | 318 transfer_buffers_[id] = buffer; |
323 #endif | |
324 | 319 |
325 return buffer; | 320 return buffer; |
326 } | 321 } |
327 | 322 |
328 void CommandBufferProxy::SetToken(int32 token) { | 323 void CommandBufferProxy::SetToken(int32 token) { |
329 // Not implemented in proxy. | 324 // Not implemented in proxy. |
330 NOTREACHED(); | 325 NOTREACHED(); |
331 } | 326 } |
332 | 327 |
333 void CommandBufferProxy::OnNotifyRepaint() { | 328 void CommandBufferProxy::OnNotifyRepaint() { |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 454 |
460 void CommandBufferProxy::SetOnConsoleMessageCallback( | 455 void CommandBufferProxy::SetOnConsoleMessageCallback( |
461 const GpuConsoleMessageCallback& callback) { | 456 const GpuConsoleMessageCallback& callback) { |
462 console_message_callback_ = callback; | 457 console_message_callback_ = callback; |
463 } | 458 } |
464 | 459 |
465 void CommandBufferProxy::TryUpdateState() { | 460 void CommandBufferProxy::TryUpdateState() { |
466 if (last_state_.error == gpu::error::kNoError) | 461 if (last_state_.error == gpu::error::kNoError) |
467 shared_state_->Read(&last_state_); | 462 shared_state_->Read(&last_state_); |
468 } | 463 } |
OLD | NEW |