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 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 6 #define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
7 | 7 |
8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <queue> | 11 #include <queue> |
12 #include <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
| 16 #include "../client/buffer_tracker.h" |
| 17 #include "../client/gles2_cmd_helper.h" |
| 18 #include "../client/gles2_interface.h" |
| 19 #include "../client/query_tracker.h" |
| 20 #include "../client/ref_counted.h" |
| 21 #include "../client/ring_buffer.h" |
| 22 #include "../client/share_group.h" |
16 #include "../common/compiler_specific.h" | 23 #include "../common/compiler_specific.h" |
17 #include "../common/debug_marker_manager.h" | 24 #include "../common/debug_marker_manager.h" |
18 #include "../common/gles2_cmd_utils.h" | 25 #include "../common/gles2_cmd_utils.h" |
19 #include "../common/scoped_ptr.h" | 26 #include "../common/scoped_ptr.h" |
20 #include "../client/ref_counted.h" | |
21 #include "../client/gles2_cmd_helper.h" | |
22 #include "../client/gles2_interface.h" | |
23 #include "../client/query_tracker.h" | |
24 #include "../client/ring_buffer.h" | |
25 #include "../client/share_group.h" | |
26 #include "gles2_impl_export.h" | 27 #include "gles2_impl_export.h" |
27 | 28 |
28 #if !defined(NDEBUG) && !defined(__native_client__) && !defined(GLES2_CONFORMANC
E_TESTS) // NOLINT | 29 #if !defined(NDEBUG) && !defined(__native_client__) && !defined(GLES2_CONFORMANC
E_TESTS) // NOLINT |
29 #if defined(GLES2_INLINE_OPTIMIZATION) | 30 #if defined(GLES2_INLINE_OPTIMIZATION) |
30 // TODO(gman): Replace with macros that work with inline optmization. | 31 // TODO(gman): Replace with macros that work with inline optmization. |
31 #define GPU_CLIENT_SINGLE_THREAD_CHECK() | 32 #define GPU_CLIENT_SINGLE_THREAD_CHECK() |
32 #define GPU_CLIENT_LOG(args) | 33 #define GPU_CLIENT_LOG(args) |
33 #define GPU_CLIENT_LOG_CODE_BLOCK(code) | 34 #define GPU_CLIENT_LOG_CODE_BLOCK(code) |
34 #define GPU_CLIENT_DCHECK_CODE_BLOCK(code) | 35 #define GPU_CLIENT_DCHECK_CODE_BLOCK(code) |
35 #else | 36 #else |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 477 |
477 IdHandlerInterface* GetIdHandler(int id_namespace) const; | 478 IdHandlerInterface* GetIdHandler(int id_namespace) const; |
478 | 479 |
479 void FinishHelper(); | 480 void FinishHelper(); |
480 | 481 |
481 // Asserts that the context is lost. | 482 // Asserts that the context is lost. |
482 // NOTE: This is an expensive call and should only be called | 483 // NOTE: This is an expensive call and should only be called |
483 // for error checking. | 484 // for error checking. |
484 bool MustBeContextLost(); | 485 bool MustBeContextLost(); |
485 | 486 |
| 487 BufferTracker::Buffer* GetBoundPixelUnpackTransferBufferIfValid( |
| 488 const char* function_name, GLuint offset, GLsizei size); |
| 489 |
486 const std::string& GetLogPrefix() const; | 490 const std::string& GetLogPrefix() const; |
487 | 491 |
488 GLES2Util util_; | 492 GLES2Util util_; |
489 GLES2CmdHelper* helper_; | 493 GLES2CmdHelper* helper_; |
490 TransferBufferInterface* transfer_buffer_; | 494 TransferBufferInterface* transfer_buffer_; |
491 std::string last_error_; | 495 std::string last_error_; |
492 DebugMarkerManager debug_marker_manager_; | 496 DebugMarkerManager debug_marker_manager_; |
493 std::string this_in_hex_; | 497 std::string this_in_hex_; |
494 | 498 |
495 std::queue<int32> swap_buffers_tokens_; | 499 std::queue<int32> swap_buffers_tokens_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 | 531 |
528 GLuint bound_framebuffer_; | 532 GLuint bound_framebuffer_; |
529 GLuint bound_renderbuffer_; | 533 GLuint bound_renderbuffer_; |
530 | 534 |
531 // The currently bound array buffer. | 535 // The currently bound array buffer. |
532 GLuint bound_array_buffer_id_; | 536 GLuint bound_array_buffer_id_; |
533 | 537 |
534 // The currently bound element array buffer. | 538 // The currently bound element array buffer. |
535 GLuint bound_element_array_buffer_id_; | 539 GLuint bound_element_array_buffer_id_; |
536 | 540 |
| 541 // The currently bound pixel transfer buffer. |
| 542 GLuint bound_pixel_unpack_transfer_buffer_id_; |
| 543 |
537 // GL names for the buffers used to emulate client side buffers. | 544 // GL names for the buffers used to emulate client side buffers. |
538 GLuint client_side_array_id_; | 545 GLuint client_side_array_id_; |
539 GLuint client_side_element_array_id_; | 546 GLuint client_side_element_array_id_; |
540 | 547 |
541 // Info for each vertex attribute saved so we can simulate client side | 548 // Info for each vertex attribute saved so we can simulate client side |
542 // buffers. | 549 // buffers. |
543 scoped_ptr<ClientSideBufferHelper> client_side_buffer_helper_; | 550 scoped_ptr<ClientSideBufferHelper> client_side_buffer_helper_; |
544 | 551 |
545 // The currently bound vertex array object (VAO) | 552 // The currently bound vertex array object (VAO) |
546 GLuint bound_vertex_array_id_; | 553 GLuint bound_vertex_array_id_; |
(...skipping 24 matching lines...) Expand all Loading... |
571 typedef std::map<const void*, MappedTexture> MappedTextureMap; | 578 typedef std::map<const void*, MappedTexture> MappedTextureMap; |
572 MappedTextureMap mapped_textures_; | 579 MappedTextureMap mapped_textures_; |
573 | 580 |
574 scoped_ptr<MappedMemoryManager> mapped_memory_; | 581 scoped_ptr<MappedMemoryManager> mapped_memory_; |
575 | 582 |
576 scoped_refptr<ShareGroup> share_group_; | 583 scoped_refptr<ShareGroup> share_group_; |
577 | 584 |
578 scoped_ptr<QueryTracker> query_tracker_; | 585 scoped_ptr<QueryTracker> query_tracker_; |
579 QueryTracker::Query* current_query_; | 586 QueryTracker::Query* current_query_; |
580 | 587 |
| 588 scoped_ptr<BufferTracker> buffer_tracker_; |
| 589 |
581 ErrorMessageCallback* error_message_callback_; | 590 ErrorMessageCallback* error_message_callback_; |
582 | 591 |
583 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); | 592 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); |
584 }; | 593 }; |
585 | 594 |
586 inline bool GLES2Implementation::GetBufferParameterivHelper( | 595 inline bool GLES2Implementation::GetBufferParameterivHelper( |
587 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 596 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
588 return false; | 597 return false; |
589 } | 598 } |
590 | 599 |
(...skipping 22 matching lines...) Expand all Loading... |
613 | 622 |
614 inline bool GLES2Implementation::GetTexParameterivHelper( | 623 inline bool GLES2Implementation::GetTexParameterivHelper( |
615 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 624 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
616 return false; | 625 return false; |
617 } | 626 } |
618 | 627 |
619 } // namespace gles2 | 628 } // namespace gles2 |
620 } // namespace gpu | 629 } // namespace gpu |
621 | 630 |
622 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 631 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
OLD | NEW |