| 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> |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 584 |
| 585 // Asserts that the context is lost. | 585 // Asserts that the context is lost. |
| 586 // NOTE: This is an expensive call and should only be called | 586 // NOTE: This is an expensive call and should only be called |
| 587 // for error checking. | 587 // for error checking. |
| 588 bool MustBeContextLost(); | 588 bool MustBeContextLost(); |
| 589 | 589 |
| 590 void RunIfContextNotLost(const base::Closure& callback); | 590 void RunIfContextNotLost(const base::Closure& callback); |
| 591 | 591 |
| 592 void OnSwapBuffersComplete(); | 592 void OnSwapBuffersComplete(); |
| 593 | 593 |
| 594 // Free transfer buffer if unused token already passed, or free pending |
| 595 // the unused token if not. |
| 596 void FreeTransferBuffer(BufferTracker::Buffer* buffer); |
| 597 |
| 598 // Free and remove buffer if no async upload in progress. If in progress, |
| 599 // unmanage the buffer and free and destroy when upload completed. |
| 600 void DisposeTransferBuffer(BufferTracker::Buffer* buffer); |
| 601 |
| 602 // Used for keeping track of async upload buffers. |
| 603 void CheckBuffersPendingAsyncComplete(); |
| 604 |
| 605 // Internal async upload query. |
| 606 void BeginQueryAsyncPixelUnpackCompleted(BufferTracker::Buffer *buffer); |
| 607 void EndQueryAsyncPixelUnpackCompleted(); |
| 608 |
| 594 bool GetBoundPixelTransferBuffer( | 609 bool GetBoundPixelTransferBuffer( |
| 595 GLenum target, const char* function_name, GLuint* buffer_id); | 610 GLenum target, const char* function_name, GLuint* buffer_id); |
| 596 BufferTracker::Buffer* GetBoundPixelUnpackTransferBufferIfValid( | 611 BufferTracker::Buffer* GetBoundPixelUnpackTransferBufferIfValid( |
| 597 GLuint buffer_id, | 612 GLuint buffer_id, |
| 598 const char* function_name, GLuint offset, GLsizei size); | 613 const char* function_name, GLuint offset, GLsizei size); |
| 599 | 614 |
| 600 const std::string& GetLogPrefix() const; | 615 const std::string& GetLogPrefix() const; |
| 601 | 616 |
| 602 #if defined(GL_CLIENT_FAIL_GL_ERRORS) | 617 #if defined(GL_CLIENT_FAIL_GL_ERRORS) |
| 603 void CheckGLError(); | 618 void CheckGLError(); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 | 707 |
| 693 typedef std::map<const void*, MappedTexture> MappedTextureMap; | 708 typedef std::map<const void*, MappedTexture> MappedTextureMap; |
| 694 MappedTextureMap mapped_textures_; | 709 MappedTextureMap mapped_textures_; |
| 695 | 710 |
| 696 scoped_ptr<MappedMemoryManager> mapped_memory_; | 711 scoped_ptr<MappedMemoryManager> mapped_memory_; |
| 697 | 712 |
| 698 scoped_refptr<ShareGroup> share_group_; | 713 scoped_refptr<ShareGroup> share_group_; |
| 699 | 714 |
| 700 scoped_ptr<QueryTracker> query_tracker_; | 715 scoped_ptr<QueryTracker> query_tracker_; |
| 701 QueryTracker::Query* current_query_; | 716 QueryTracker::Query* current_query_; |
| 717 QueryTracker::Query* current_private_unpack_query_; |
| 702 | 718 |
| 703 scoped_ptr<BufferTracker> buffer_tracker_; | 719 scoped_ptr<BufferTracker> buffer_tracker_; |
| 720 typedef std::list<BufferTracker::Buffer*> BufferList; |
| 721 BufferList released_buffers_pending_async_complete_; |
| 704 | 722 |
| 705 scoped_ptr<GpuMemoryBufferTracker> gpu_memory_buffer_tracker_; | 723 scoped_ptr<GpuMemoryBufferTracker> gpu_memory_buffer_tracker_; |
| 706 | 724 |
| 707 ErrorMessageCallback* error_message_callback_; | 725 ErrorMessageCallback* error_message_callback_; |
| 708 | 726 |
| 709 scoped_ptr<std::string> current_trace_name_; | 727 scoped_ptr<std::string> current_trace_name_; |
| 710 | 728 |
| 711 GpuControl* gpu_control_; | 729 GpuControl* gpu_control_; |
| 712 | 730 |
| 713 bool surface_visible_; | 731 bool surface_visible_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 | 771 |
| 754 inline bool GLES2Implementation::GetTexParameterivHelper( | 772 inline bool GLES2Implementation::GetTexParameterivHelper( |
| 755 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { | 773 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { |
| 756 return false; | 774 return false; |
| 757 } | 775 } |
| 758 | 776 |
| 759 } // namespace gles2 | 777 } // namespace gles2 |
| 760 } // namespace gpu | 778 } // namespace gpu |
| 761 | 779 |
| 762 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ | 780 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ |
| OLD | NEW |