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 "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "../client/buffer_tracker.h" | 17 #include "../client/buffer_tracker.h" |
18 #include "../client/client_context_state.h" | 18 #include "../client/client_context_state.h" |
19 #include "../client/gpu_memory_buffer_tracker.h" | |
greggman
2013/04/25 23:45:34
Can you just forward declare GPUMemoryBufferTracke
kaanb1
2013/04/26 03:01:21
Done for gpu_memory_buffer_tracker but we need buf
| |
19 #include "../client/gles2_cmd_helper.h" | 20 #include "../client/gles2_cmd_helper.h" |
20 #include "../client/gles2_interface.h" | 21 #include "../client/gles2_interface.h" |
21 #include "../client/query_tracker.h" | 22 #include "../client/query_tracker.h" |
22 #include "../client/ref_counted.h" | 23 #include "../client/ref_counted.h" |
23 #include "../client/ring_buffer.h" | 24 #include "../client/ring_buffer.h" |
24 #include "../client/share_group.h" | 25 #include "../client/share_group.h" |
25 #include "../common/compiler_specific.h" | 26 #include "../common/compiler_specific.h" |
26 #include "../common/debug_marker_manager.h" | 27 #include "../common/debug_marker_manager.h" |
27 #include "../common/gles2_cmd_utils.h" | 28 #include "../common/gles2_cmd_utils.h" |
28 #include "gles2_impl_export.h" | 29 #include "gles2_impl_export.h" |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
428 void DeleteVertexArraysOESStub(GLsizei n, const GLuint* arrays); | 429 void DeleteVertexArraysOESStub(GLsizei n, const GLuint* arrays); |
429 | 430 |
430 void BufferDataHelper( | 431 void BufferDataHelper( |
431 GLenum target, GLsizeiptr size, const void* data, GLenum usage); | 432 GLenum target, GLsizeiptr size, const void* data, GLenum usage); |
432 void BufferSubDataHelper( | 433 void BufferSubDataHelper( |
433 GLenum target, GLintptr offset, GLsizeiptr size, const void* data); | 434 GLenum target, GLintptr offset, GLsizeiptr size, const void* data); |
434 void BufferSubDataHelperImpl( | 435 void BufferSubDataHelperImpl( |
435 GLenum target, GLintptr offset, GLsizeiptr size, const void* data, | 436 GLenum target, GLintptr offset, GLsizeiptr size, const void* data, |
436 ScopedTransferBufferPtr* buffer); | 437 ScopedTransferBufferPtr* buffer); |
437 | 438 |
439 // Helper for ImageBufferData | |
440 void ImageBufferDataHelperCHROMIUM( | |
441 GLenum target, GLsizei width, GLsizei height); | |
442 | |
438 // Helper for GetVertexAttrib | 443 // Helper for GetVertexAttrib |
439 bool GetVertexAttribHelper(GLuint index, GLenum pname, uint32* param); | 444 bool GetVertexAttribHelper(GLuint index, GLenum pname, uint32* param); |
440 | 445 |
441 GLuint GetMaxValueInBufferCHROMIUMHelper( | 446 GLuint GetMaxValueInBufferCHROMIUMHelper( |
442 GLuint buffer_id, GLsizei count, GLenum type, GLuint offset); | 447 GLuint buffer_id, GLsizei count, GLenum type, GLuint offset); |
443 | 448 |
444 void RestoreElementAndArrayBuffers(bool restore); | 449 void RestoreElementAndArrayBuffers(bool restore); |
445 void RestoreArrayBuffer(bool restrore); | 450 void RestoreArrayBuffer(bool restrore); |
446 | 451 |
447 // The pixels pointer should already account for unpack skip rows and skip | 452 // The pixels pointer should already account for unpack skip rows and skip |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
491 const std::string& GetLogPrefix() const; | 496 const std::string& GetLogPrefix() const; |
492 | 497 |
493 #if defined(GL_CLIENT_FAIL_GL_ERRORS) | 498 #if defined(GL_CLIENT_FAIL_GL_ERRORS) |
494 void CheckGLError(); | 499 void CheckGLError(); |
495 void FailGLError(GLenum error); | 500 void FailGLError(GLenum error); |
496 #else | 501 #else |
497 void CheckGLError() { } | 502 void CheckGLError() { } |
498 void FailGLError(GLenum /* error */) { } | 503 void FailGLError(GLenum /* error */) { } |
499 #endif | 504 #endif |
500 | 505 |
506 bool GetBoundGpuMemoryBuffer(const char* function_name, GLuint* buffer_id); | |
507 void* GetNativeHandleForBoundGpuMemoryBuffer(); | |
508 | |
501 GLES2Util util_; | 509 GLES2Util util_; |
502 GLES2CmdHelper* helper_; | 510 GLES2CmdHelper* helper_; |
503 TransferBufferInterface* transfer_buffer_; | 511 TransferBufferInterface* transfer_buffer_; |
504 std::string last_error_; | 512 std::string last_error_; |
505 DebugMarkerManager debug_marker_manager_; | 513 DebugMarkerManager debug_marker_manager_; |
506 std::string this_in_hex_; | 514 std::string this_in_hex_; |
507 | 515 |
508 std::queue<int32> swap_buffers_tokens_; | 516 std::queue<int32> swap_buffers_tokens_; |
509 std::queue<int32> rate_limit_tokens_; | 517 std::queue<int32> rate_limit_tokens_; |
510 | 518 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
547 // The program in use by glUseProgram | 555 // The program in use by glUseProgram |
548 GLuint current_program_; | 556 GLuint current_program_; |
549 | 557 |
550 // The currently bound array buffer. | 558 // The currently bound array buffer. |
551 GLuint bound_array_buffer_id_; | 559 GLuint bound_array_buffer_id_; |
552 | 560 |
553 // The currently bound pixel transfer buffers. | 561 // The currently bound pixel transfer buffers. |
554 GLuint bound_pixel_pack_transfer_buffer_id_; | 562 GLuint bound_pixel_pack_transfer_buffer_id_; |
555 GLuint bound_pixel_unpack_transfer_buffer_id_; | 563 GLuint bound_pixel_unpack_transfer_buffer_id_; |
556 | 564 |
565 // The currently bound GPU memory buffer | |
566 GLuint bound_gpu_memory_buffer_id_; | |
567 | |
557 // Client side management for vertex array objects. Needed to correctly | 568 // Client side management for vertex array objects. Needed to correctly |
558 // track client side arrays. | 569 // track client side arrays. |
559 scoped_ptr<VertexArrayObjectManager> vertex_array_object_manager_; | 570 scoped_ptr<VertexArrayObjectManager> vertex_array_object_manager_; |
560 | 571 |
561 GLuint reserved_ids_[2]; | 572 GLuint reserved_ids_[2]; |
562 | 573 |
563 // Current GL error bits. | 574 // Current GL error bits. |
564 uint32 error_bits_; | 575 uint32 error_bits_; |
565 | 576 |
566 // Whether or not to print debugging info. | 577 // Whether or not to print debugging info. |
(...skipping 26 matching lines...) Expand all Loading... | |
593 ShaderPrecisionCacheMap; | 604 ShaderPrecisionCacheMap; |
594 ShaderPrecisionCacheMap shader_precision_cache_; | 605 ShaderPrecisionCacheMap shader_precision_cache_; |
595 | 606 |
596 scoped_refptr<ShareGroup> share_group_; | 607 scoped_refptr<ShareGroup> share_group_; |
597 | 608 |
598 scoped_ptr<QueryTracker> query_tracker_; | 609 scoped_ptr<QueryTracker> query_tracker_; |
599 QueryTracker::Query* current_query_; | 610 QueryTracker::Query* current_query_; |
600 | 611 |
601 scoped_ptr<BufferTracker> buffer_tracker_; | 612 scoped_ptr<BufferTracker> buffer_tracker_; |
602 | 613 |
614 scoped_ptr<GpuMemoryBufferTracker> gpu_memory_buffer_tracker_; | |
615 | |
603 ErrorMessageCallback* error_message_callback_; | 616 ErrorMessageCallback* error_message_callback_; |
604 | 617 |
605 scoped_ptr<std::string> current_trace_name_; | 618 scoped_ptr<std::string> current_trace_name_; |
606 | 619 |
607 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); | 620 DISALLOW_COPY_AND_ASSIGN(GLES2Implementation); |
608 }; | 621 }; |
609 | 622 |
610 inline bool GLES2Implementation::GetBufferParameterivHelper( | 623 inline bool GLES2Implementation::GetBufferParameterivHelper( |
611 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 624 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
612 return false; | 625 return false; |
(...skipping 24 matching lines...) Expand all Loading... | |
637 | 650 |
638 inline bool GLES2Implementation::GetTexParameterivHelper( | 651 inline bool GLES2Implementation::GetTexParameterivHelper( |
639 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 652 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
640 return false; | 653 return false; |
641 } | 654 } |
642 | 655 |
643 } // namespace gles2 | 656 } // namespace gles2 |
644 } // namespace gpu | 657 } // namespace gpu |
645 | 658 |
646 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 659 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
OLD | NEW |