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_impl.h" | 5 #include "content/common/gpu/client/command_buffer_proxy_impl.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/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 route_id_, handle, &result, &capabilities_))) { | 159 route_id_, handle, &result, &capabilities_))) { |
160 LOG(ERROR) << "Could not send GpuCommandBufferMsg_Initialize."; | 160 LOG(ERROR) << "Could not send GpuCommandBufferMsg_Initialize."; |
161 return false; | 161 return false; |
162 } | 162 } |
163 | 163 |
164 if (!result) { | 164 if (!result) { |
165 LOG(ERROR) << "Failed to initialize command buffer service."; | 165 LOG(ERROR) << "Failed to initialize command buffer service."; |
166 return false; | 166 return false; |
167 } | 167 } |
168 | 168 |
169 capabilities_.map_image = true; | |
170 | |
171 return true; | 169 return true; |
172 } | 170 } |
173 | 171 |
174 gpu::CommandBuffer::State CommandBufferProxyImpl::GetState() { | 172 gpu::CommandBuffer::State CommandBufferProxyImpl::GetState() { |
175 // Send will flag state with lost context if IPC fails. | 173 // Send will flag state with lost context if IPC fails. |
176 if (last_state_.error == gpu::error::kNoError) { | 174 if (last_state_.error == gpu::error::kNoError) { |
177 gpu::CommandBuffer::State state; | 175 gpu::CommandBuffer::State state; |
178 if (Send(new GpuCommandBufferMsg_GetState(route_id_, &state))) | 176 if (Send(new GpuCommandBufferMsg_GetState(route_id_, &state))) |
179 OnUpdateState(state); | 177 OnUpdateState(state); |
180 } | 178 } |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // Not implemented in proxy. | 372 // Not implemented in proxy. |
375 NOTREACHED(); | 373 NOTREACHED(); |
376 } | 374 } |
377 | 375 |
378 void CommandBufferProxyImpl::SetContextLostReason( | 376 void CommandBufferProxyImpl::SetContextLostReason( |
379 gpu::error::ContextLostReason reason) { | 377 gpu::error::ContextLostReason reason) { |
380 // Not implemented in proxy. | 378 // Not implemented in proxy. |
381 NOTREACHED(); | 379 NOTREACHED(); |
382 } | 380 } |
383 | 381 |
384 gpu::Capabilities CommandBufferProxyImpl::GetCapabilities() { | |
385 return capabilities_; | |
386 } | |
387 | |
388 gfx::GpuMemoryBuffer* CommandBufferProxyImpl::CreateGpuMemoryBuffer( | 382 gfx::GpuMemoryBuffer* CommandBufferProxyImpl::CreateGpuMemoryBuffer( |
389 size_t width, | 383 size_t width, |
390 size_t height, | 384 size_t height, |
391 unsigned internalformat, | 385 unsigned internalformat, |
392 int32* id) { | 386 int32* id) { |
393 *id = -1; | 387 *id = -1; |
394 | 388 |
395 if (last_state_.error != gpu::error::kNoError) | 389 if (last_state_.error != gpu::error::kNoError) |
396 return NULL; | 390 return NULL; |
397 | 391 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 const GpuConsoleMessageCallback& callback) { | 595 const GpuConsoleMessageCallback& callback) { |
602 console_message_callback_ = callback; | 596 console_message_callback_ = callback; |
603 } | 597 } |
604 | 598 |
605 void CommandBufferProxyImpl::TryUpdateState() { | 599 void CommandBufferProxyImpl::TryUpdateState() { |
606 if (last_state_.error == gpu::error::kNoError) | 600 if (last_state_.error == gpu::error::kNoError) |
607 shared_state()->Read(&last_state_); | 601 shared_state()->Read(&last_state_); |
608 } | 602 } |
609 | 603 |
610 } // namespace content | 604 } // namespace content |
OLD | NEW |