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

Unified Diff: cc/resource_provider.h

Issue 11622008: cc: Defer texture allocation (to allow async allocations). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Track uninitialized textures. Fix tests. Created 8 years 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/resource_provider.h
diff --git a/cc/resource_provider.h b/cc/resource_provider.h
index d90d2244340edfdc731913b8505f1dde6c5e4005..76e889bfaa57b56a6c056f77db9a0ee0aa630b55 100644
--- a/cc/resource_provider.h
+++ b/cc/resource_provider.h
@@ -75,6 +75,10 @@ public:
// Creates a resource which is tagged as being managed for GPU memory accounting purposes.
ResourceId createManagedResource(const gfx::Size&, GLenum format, TextureUsageHint);
+ // For tests only! Otherwise, implicitly allocate via lockForWrite or setPixels variant.
+ ResourceId createAllocatedResource(const gfx::Size&, GLenum format, TextureUsageHint);
+ ResourceId createAllocatedManagedResource(const gfx::Size&, GLenum format, TextureUsageHint);
piman 2012/12/18 22:41:38 How about one explicit allocateResourceForTest(Res
+
// You can also explicitly create a specific resource type.
ResourceId createGLTexture(const gfx::Size&, GLenum format, GLenum texturePool, TextureUsageHint);
@@ -250,6 +254,7 @@ private:
bool exported;
bool markedForDeletion;
bool pendingSetPixels;
+ bool allocated;
gfx::Size size;
GLenum format;
// TODO(skyostil): Use a separate sampler object for filter state.
@@ -277,6 +282,8 @@ private:
bool transferResource(WebKit::WebGraphicsContext3D*, ResourceId, TransferableResource*);
void deleteResourceInternal(ResourceMap::iterator it);
+ void lazyAllocate(ResourceId);
+ void lazyAllocate(Resource*);
OutputSurface* m_outputSurface;
ResourceId m_nextId;

Powered by Google App Engine
This is Rietveld 408576698