Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.h

Issue 116863003: gpu: Reuse transfer buffers more aggresively (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: [WIP] Review comments follow-up Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Internal async upload query.
599 void BeginInternalQueryAsyncPixelUnpackCompleted(
600 BufferTracker::Buffer *buffer);
601 void EndInternalQueryAsyncPixelUnpackCompleted();
602
603 void MarkPixelTransferBufferLastUsage(BufferTracker::Buffer* buffer);
604
594 bool GetBoundPixelTransferBuffer( 605 bool GetBoundPixelTransferBuffer(
595 GLenum target, const char* function_name, GLuint* buffer_id); 606 GLenum target, const char* function_name, GLuint* buffer_id);
596 BufferTracker::Buffer* GetBoundPixelUnpackTransferBufferIfValid( 607 BufferTracker::Buffer* GetBoundPixelUnpackTransferBufferIfValid(
597 GLuint buffer_id, 608 GLuint buffer_id,
598 const char* function_name, GLuint offset, GLsizei size); 609 const char* function_name, GLuint offset, GLsizei size);
599 610
600 const std::string& GetLogPrefix() const; 611 const std::string& GetLogPrefix() const;
601 612
602 #if defined(GL_CLIENT_FAIL_GL_ERRORS) 613 #if defined(GL_CLIENT_FAIL_GL_ERRORS)
603 void CheckGLError(); 614 void CheckGLError();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 MappedBufferMap mapped_buffers_; 702 MappedBufferMap mapped_buffers_;
692 703
693 typedef std::map<const void*, MappedTexture> MappedTextureMap; 704 typedef std::map<const void*, MappedTexture> MappedTextureMap;
694 MappedTextureMap mapped_textures_; 705 MappedTextureMap mapped_textures_;
695 706
696 scoped_ptr<MappedMemoryManager> mapped_memory_; 707 scoped_ptr<MappedMemoryManager> mapped_memory_;
697 708
698 scoped_refptr<ShareGroup> share_group_; 709 scoped_refptr<ShareGroup> share_group_;
699 710
700 scoped_ptr<QueryTracker> query_tracker_; 711 scoped_ptr<QueryTracker> query_tracker_;
701 typedef std::map<GLuint, QueryTracker::Query*> QueryMap; 712 typedef std::pair<GLuint, bool> QueryKey;
713 typedef std::map<QueryKey, QueryTracker::Query*> QueryMap;
702 QueryMap current_queries_; 714 QueryMap current_queries_;
703 715
704 scoped_ptr<BufferTracker> buffer_tracker_; 716 scoped_ptr<BufferTracker> buffer_tracker_;
705 717
706 scoped_ptr<GpuMemoryBufferTracker> gpu_memory_buffer_tracker_; 718 scoped_ptr<GpuMemoryBufferTracker> gpu_memory_buffer_tracker_;
707 719
708 ErrorMessageCallback* error_message_callback_; 720 ErrorMessageCallback* error_message_callback_;
709 721
710 scoped_ptr<std::string> current_trace_name_; 722 scoped_ptr<std::string> current_trace_name_;
711 723
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 766
755 inline bool GLES2Implementation::GetTexParameterivHelper( 767 inline bool GLES2Implementation::GetTexParameterivHelper(
756 GLenum /* target */, GLenum /* pname */, GLint* /* params */) { 768 GLenum /* target */, GLenum /* pname */, GLint* /* params */) {
757 return false; 769 return false;
758 } 770 }
759 771
760 } // namespace gles2 772 } // namespace gles2
761 } // namespace gpu 773 } // namespace gpu
762 774
763 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_ 775 #endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698