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

Unified Diff: cc/resources/resource_provider.h

Issue 14409006: cc: Changes to use GL API for GpuMemoryBuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@glapi
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: cc/resources/resource_provider.h
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index e964437757ba5ed4e6f7c8356bb083cc00c78e67..98c05cca193a651ec5233187abf842be604dc46b 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -314,11 +314,15 @@ class CC_EXPORT ResourceProvider {
offscreen_context_provider_ = offscreen_context_provider;
}
+ // Sets if zero-copy GPU memory buffers should be used.
+ void SetUseGpuMemoryBuffers(bool use_gpu_memory_buffers);
+
private:
struct Resource {
Resource();
~Resource();
- Resource(unsigned texture_id, gfx::Size size, GLenum format, GLenum filter);
+ Resource(unsigned texture_id, gfx::Size size, GLenum format, GLenum filter,
+ bool use_gpu_memory_buffer);
Resource(uint8_t* pixels, gfx::Size size, GLenum format, GLenum filter);
unsigned gl_id;
@@ -344,6 +348,7 @@ class CC_EXPORT ResourceProvider {
// TODO(skyostil): Use a separate sampler object for filter state.
GLenum filter;
ResourceType type;
+ bool use_gpu_memory_buffer;
};
typedef base::hash_map<ResourceId, Resource> ResourceMap;
struct Child {
@@ -379,6 +384,7 @@ class CC_EXPORT ResourceProvider {
};
void DeleteResourceInternal(ResourceMap::iterator it, DeleteStyle style);
void LazyAllocate(Resource* resource);
+ GLenum GetTargetGivenResource(Resource* resource);
OutputSurface* output_surface_;
bool lost_output_surface_;
@@ -402,6 +408,8 @@ class CC_EXPORT ResourceProvider {
scoped_refptr<Fence> current_read_lock_fence_;
+ bool use_gpu_memory_buffers_;
+
DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
};

Powered by Google App Engine
This is Rietveld 408576698