| OLD | NEW |
| 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 "ppapi/proxy/ppb_context_3d_proxy.h" | 5 #include "ppapi/proxy/ppb_context_3d_proxy.h" |
| 6 | 6 |
| 7 #include "base/hash_tables.h" | 7 #include "base/hash_tables.h" |
| 8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 9 #include "gpu/command_buffer/client/gles2_implementation.h" | 9 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 390 |
| 391 int32_t Context3D::GetAttrib(int32_t attribute, int32_t* value) { | 391 int32_t Context3D::GetAttrib(int32_t attribute, int32_t* value) { |
| 392 // TODO(alokp): Implement me. | 392 // TODO(alokp): Implement me. |
| 393 return 0; | 393 return 0; |
| 394 } | 394 } |
| 395 | 395 |
| 396 int32_t Context3D::BindSurfaces(PP_Resource pp_draw, PP_Resource pp_read) { | 396 int32_t Context3D::BindSurfaces(PP_Resource pp_draw, PP_Resource pp_read) { |
| 397 // TODO(alokp): Support separate draw-read surfaces. | 397 // TODO(alokp): Support separate draw-read surfaces. |
| 398 DCHECK_EQ(pp_draw, pp_read); | 398 DCHECK_EQ(pp_draw, pp_read); |
| 399 if (pp_draw != pp_read) | 399 if (pp_draw != pp_read) |
| 400 return PP_GRAPHICS3DERROR_BAD_MATCH; | 400 return PP_ERROR_BADARGUMENT; |
| 401 | 401 |
| 402 EnterResourceNoLock<PPB_Surface3D_API> enter_draw(pp_draw, false); | 402 EnterResourceNoLock<PPB_Surface3D_API> enter_draw(pp_draw, false); |
| 403 EnterResourceNoLock<PPB_Surface3D_API> enter_read(pp_read, false); | 403 EnterResourceNoLock<PPB_Surface3D_API> enter_read(pp_read, false); |
| 404 Surface3D* draw_surface = enter_draw.succeeded() ? | 404 Surface3D* draw_surface = enter_draw.succeeded() ? |
| 405 static_cast<Surface3D*>(enter_draw.object()) : NULL; | 405 static_cast<Surface3D*>(enter_draw.object()) : NULL; |
| 406 Surface3D* read_surface = enter_read.succeeded() ? | 406 Surface3D* read_surface = enter_read.succeeded() ? |
| 407 static_cast<Surface3D*>(enter_read.object()) : NULL; | 407 static_cast<Surface3D*>(enter_read.object()) : NULL; |
| 408 | 408 |
| 409 if (pp_draw && !draw_surface) | 409 if (pp_draw && !draw_surface) |
| 410 return PP_ERROR_BADRESOURCE; | 410 return PP_ERROR_BADRESOURCE; |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 uint32_t shm_size = 0; | 719 uint32_t shm_size = 0; |
| 720 if (enter.succeeded() && | 720 if (enter.succeeded() && |
| 721 enter.object()->GetTransferBuffer(id, &shm_handle, &shm_size)) { | 721 enter.object()->GetTransferBuffer(id, &shm_handle, &shm_size)) { |
| 722 *transfer_buffer = TransportSHMHandleFromInt(dispatcher(), shm_handle); | 722 *transfer_buffer = TransportSHMHandleFromInt(dispatcher(), shm_handle); |
| 723 *size = shm_size; | 723 *size = shm_size; |
| 724 } | 724 } |
| 725 } | 725 } |
| 726 | 726 |
| 727 } // namespace proxy | 727 } // namespace proxy |
| 728 } // namespace pp | 728 } // namespace pp |
| OLD | NEW |