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

Unified Diff: gpu/command_buffer/service/buffer_manager.h

Issue 2383333002: Update shadowed data in MapBufferRange path. (Closed)
Patch Set: This should work Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/buffer_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/buffer_manager.h
diff --git a/gpu/command_buffer/service/buffer_manager.h b/gpu/command_buffer/service/buffer_manager.h
index f2456a4166ac76dee192a45a10078994205c8a0c..bb69e7dfe0c2f2603a82f662b039868c4f0a0de4 100644
--- a/gpu/command_buffer/service/buffer_manager.h
+++ b/gpu/command_buffer/service/buffer_manager.h
@@ -38,10 +38,11 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> {
GLsizeiptr size;
GLenum access;
void* pointer; // Pointer returned by driver.
- scoped_refptr<gpu::Buffer> shm; // Client side mem.
+ scoped_refptr<gpu::Buffer> shm; // Client side mem buffer.
+ unsigned int shm_offset; // Client side mem buffer offset.
- MappedRange(GLintptr offset, GLsizeiptr size, GLenum access,
- void* pointer, scoped_refptr<gpu::Buffer> shm);
+ MappedRange(GLintptr offset, GLsizeiptr size, GLenum access, void* pointer,
+ scoped_refptr<gpu::Buffer> shm, unsigned int shm_offset);
~MappedRange();
void* GetShmPointer() const;
};
@@ -60,6 +61,10 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> {
return usage_;
}
+ bool shadowed() const {
+ return !shadow_.empty();
+ }
+
// Gets the maximum value in the buffer for the given range interpreted as
// the given type. Returns false if offset and count are out of range.
// offset is in bytes.
@@ -73,6 +78,10 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> {
// Check if an offset, size range is valid for the current buffer.
bool CheckRange(GLintptr offset, GLsizeiptr size) const;
+ // Sets a range of this buffer's shadowed data. Returns false if offset/size
+ // is out of range.
+ bool SetRange(GLintptr offset, GLsizeiptr size, const GLvoid * data);
+
bool IsDeleted() const {
return deleted_;
}
@@ -86,8 +95,10 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> {
}
void SetMappedRange(GLintptr offset, GLsizeiptr size, GLenum access,
- void* pointer, scoped_refptr<gpu::Buffer> shm) {
- mapped_range_.reset(new MappedRange(offset, size, access, pointer, shm));
+ void* pointer, scoped_refptr<gpu::Buffer> shm,
+ unsigned int shm_offset) {
+ mapped_range_.reset(
+ new MappedRange(offset, size, access, pointer, shm, shm_offset));
}
void RemoveMappedRange() {
@@ -148,8 +159,6 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> {
initial_target_ = target;
}
- bool shadowed() const { return !shadow_.empty(); }
-
void MarkAsDeleted() {
deleted_ = true;
}
@@ -169,11 +178,6 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> {
bool use_shadow,
bool is_client_side_array);
- // Sets a range of data for this buffer. Returns false if the offset or size
- // is out of range.
- bool SetRange(
- GLintptr offset, GLsizeiptr size, const GLvoid * data);
-
// Clears any cache of index ranges.
void ClearCache();
« no previous file with comments | « no previous file | gpu/command_buffer/service/buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698