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

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

Issue 12892005: Implement client side PBOs for glReadPixel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make GLHelper constructor explicit Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « gpu/GLES2/gl2extchromium.h ('k') | gpu/command_buffer/client/gles2_implementation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_BUFFER_TRACKER_H_ 5 #ifndef GPU_COMMAND_BUFFER_CLIENT_BUFFER_TRACKER_H_
6 #define GPU_COMMAND_BUFFER_CLIENT_BUFFER_TRACKER_H_ 6 #define GPU_COMMAND_BUFFER_CLIENT_BUFFER_TRACKER_H_
7 7
8 #include <GLES2/gl2.h> 8 #include <GLES2/gl2.h>
9 9
10 #include <queue> 10 #include <queue>
(...skipping 16 matching lines...) Expand all
27 Buffer(GLuint id, 27 Buffer(GLuint id,
28 unsigned int size, 28 unsigned int size,
29 int32 shm_id, 29 int32 shm_id,
30 uint32 shm_offset, 30 uint32 shm_offset,
31 void* address) 31 void* address)
32 : id_(id), 32 : id_(id),
33 size_(size), 33 size_(size),
34 shm_id_(shm_id), 34 shm_id_(shm_id),
35 shm_offset_(shm_offset), 35 shm_offset_(shm_offset),
36 address_(address), 36 address_(address),
37 mapped_(false) { 37 mapped_(false),
38 transfer_ready_token_(0) {
38 } 39 }
39 40
40 GLenum id() const { 41 GLenum id() const {
41 return id_; 42 return id_;
42 } 43 }
43 44
44 unsigned int size() const { 45 unsigned int size() const {
45 return size_; 46 return size_;
46 } 47 }
47 48
(...skipping 10 matching lines...) Expand all
58 } 59 }
59 60
60 void set_mapped(bool mapped) { 61 void set_mapped(bool mapped) {
61 mapped_ = mapped; 62 mapped_ = mapped;
62 } 63 }
63 64
64 bool mapped() const { 65 bool mapped() const {
65 return mapped_; 66 return mapped_;
66 } 67 }
67 68
69 void set_transfer_ready_token(int token) {
70 transfer_ready_token_ = token;
71 }
72
73 uint32 transfer_ready_token() const {
74 return transfer_ready_token_;
75 }
76
68 private: 77 private:
69 friend class BufferTracker; 78 friend class BufferTracker;
70 friend class BufferTrackerTest; 79 friend class BufferTrackerTest;
71 80
72 GLuint id_; 81 GLuint id_;
73 unsigned int size_; 82 unsigned int size_;
74 int32 shm_id_; 83 int32 shm_id_;
75 uint32 shm_offset_; 84 uint32 shm_offset_;
76 void* address_; 85 void* address_;
77 bool mapped_; 86 bool mapped_;
87 int32 transfer_ready_token_;
78 }; 88 };
79 89
80 BufferTracker(MappedMemoryManager* manager); 90 BufferTracker(MappedMemoryManager* manager);
81 ~BufferTracker(); 91 ~BufferTracker();
82 92
83 Buffer* CreateBuffer(GLuint id, GLsizeiptr size); 93 Buffer* CreateBuffer(GLuint id, GLsizeiptr size);
84 Buffer* GetBuffer(GLuint id); 94 Buffer* GetBuffer(GLuint id);
85 void RemoveBuffer(GLuint id); 95 void RemoveBuffer(GLuint id);
86 96
87 // Frees the block of memory associated with buffer, pending the passage 97 // Frees the block of memory associated with buffer, pending the passage
88 // of a token. 98 // of a token.
89 void FreePendingToken(Buffer*, int32 token); 99 void FreePendingToken(Buffer*, int32 token);
90 100
91 private: 101 private:
92 typedef gpu::hash_map<GLuint, Buffer*> BufferMap; 102 typedef gpu::hash_map<GLuint, Buffer*> BufferMap;
93 103
94 MappedMemoryManager* mapped_memory_; 104 MappedMemoryManager* mapped_memory_;
95 BufferMap buffers_; 105 BufferMap buffers_;
96 106
97 DISALLOW_COPY_AND_ASSIGN(BufferTracker); 107 DISALLOW_COPY_AND_ASSIGN(BufferTracker);
98 }; 108 };
99 109
100 } // namespace gles2 110 } // namespace gles2
101 } // namespace gpu 111 } // namespace gpu
102 112
103 #endif // GPU_COMMAND_BUFFER_CLIENT_BUFFER_TRACKER_H_ 113 #endif // GPU_COMMAND_BUFFER_CLIENT_BUFFER_TRACKER_H_
OLDNEW
« no previous file with comments | « gpu/GLES2/gl2extchromium.h ('k') | gpu/command_buffer/client/gles2_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698