| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/plugins/ppapi/ppb_context_3d_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_context_3d_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
| 9 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 9 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 10 #include "gpu/command_buffer/client/gles2_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 scoped_refptr<PPB_Context3D_Impl> context( | 187 scoped_refptr<PPB_Context3D_Impl> context( |
| 188 Resource::GetAs<PPB_Context3D_Impl>(context_id)); | 188 Resource::GetAs<PPB_Context3D_Impl>(context_id)); |
| 189 if (!context.get() || !context->command_buffer()) { | 189 if (!context.get() || !context->command_buffer()) { |
| 190 PP_Context3DTrustedState error_state = { 0 }; | 190 PP_Context3DTrustedState error_state = { 0 }; |
| 191 return error_state; | 191 return error_state; |
| 192 } | 192 } |
| 193 | 193 |
| 194 return PPStateFromGPUState(context->command_buffer()->FlushSync(put_offset)); | 194 return PPStateFromGPUState(context->command_buffer()->FlushSync(put_offset)); |
| 195 } | 195 } |
| 196 | 196 |
| 197 int32_t CreateTransferBuffer(PP_Resource context_id, size_t size) { | 197 int32_t CreateTransferBuffer(PP_Resource context_id, uint32_t size) { |
| 198 scoped_refptr<PPB_Context3D_Impl> context( | 198 scoped_refptr<PPB_Context3D_Impl> context( |
| 199 Resource::GetAs<PPB_Context3D_Impl>(context_id)); | 199 Resource::GetAs<PPB_Context3D_Impl>(context_id)); |
| 200 if (!context.get() || !context->command_buffer()) | 200 if (!context.get() || !context->command_buffer()) |
| 201 return 0; | 201 return 0; |
| 202 return context->command_buffer()->CreateTransferBuffer(size); | 202 return context->command_buffer()->CreateTransferBuffer(size); |
| 203 } | 203 } |
| 204 | 204 |
| 205 PP_Bool DestroyTransferBuffer(PP_Resource context_id, int32_t id) { | 205 PP_Bool DestroyTransferBuffer(PP_Resource context_id, int32_t id) { |
| 206 scoped_refptr<PPB_Context3D_Impl> context( | 206 scoped_refptr<PPB_Context3D_Impl> context( |
| 207 Resource::GetAs<PPB_Context3D_Impl>(context_id)); | 207 Resource::GetAs<PPB_Context3D_Impl>(context_id)); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 read_surface_->OnContextLost(); | 376 read_surface_->OnContextLost(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 gpu::CommandBuffer *PPB_Context3D_Impl::command_buffer() { | 379 gpu::CommandBuffer *PPB_Context3D_Impl::command_buffer() { |
| 380 return platform_context_.get() ? platform_context_->GetCommandBuffer() : NULL; | 380 return platform_context_.get() ? platform_context_->GetCommandBuffer() : NULL; |
| 381 } | 381 } |
| 382 | 382 |
| 383 } // namespace ppapi | 383 } // namespace ppapi |
| 384 } // namespace webkit | 384 } // namespace webkit |
| 385 | 385 |
| OLD | NEW |