Chromium Code Reviews| Index: cc/resource_provider.h |
| diff --git a/cc/resource_provider.h b/cc/resource_provider.h |
| index e75cda6e56807310ae874131492fed7a03a04519..8bb60849bfab705648690b77fd9d8cecd3e19309 100644 |
| --- a/cc/resource_provider.h |
| +++ b/cc/resource_provider.h |
| @@ -132,6 +132,11 @@ public: |
| // will wait on it. |
| void receiveFromParent(const TransferableResourceList&); |
| + // Bind the given GL resource to a texture target for sampling using the |
| + // specified minification and magnification filters. The resource must be |
| + // locked for reading. |
| + void bindForSampling(ResourceProvider::ResourceId, GLenum target, GLenum minFilter = GL_LINEAR, GLenum magFilter = GL_LINEAR); |
|
jamesr
2012/11/26 06:54:26
chrome style forbids default parameter values. can
Sami
2012/11/30 17:49:27
Ah, I wasn't exactly sure what style guide we're f
|
| + |
| // The following lock classes are part of the ResourceProvider API and are |
| // needed to read and write the resource contents. The user must ensure |
| // that they only use GL locks on GL resources, etc, and this is enforced |
| @@ -151,6 +156,14 @@ public: |
| DISALLOW_COPY_AND_ASSIGN(ScopedReadLockGL); |
| }; |
| + class CC_EXPORT ScopedSamplerGL : public ScopedReadLockGL { |
| + public: |
| + ScopedSamplerGL(ResourceProvider*, ResourceProvider::ResourceId, GLenum target, GLenum minFilter = GL_LINEAR, GLenum magFilter = GL_LINEAR); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(ScopedSamplerGL); |
| + }; |
| + |
| class CC_EXPORT ScopedWriteLockGL { |
| public: |
| ScopedWriteLockGL(ResourceProvider*, ResourceProvider::ResourceId); |
| @@ -200,8 +213,8 @@ public: |
| private: |
| struct Resource { |
| Resource(); |
| - Resource(unsigned textureId, int pool, const gfx::Size& size, GLenum format); |
| - Resource(uint8_t* pixels, int pool, const gfx::Size& size, GLenum format); |
| + Resource(unsigned textureId, int pool, const gfx::Size& size, GLenum format, GLenum minFilter, GLenum magFilter); |
| + Resource(uint8_t* pixels, int pool, const gfx::Size& size, GLenum format, GLenum minFilter, GLenum magFilter); |
| unsigned glId; |
| Mailbox mailbox; |
| @@ -214,6 +227,9 @@ private: |
| bool markedForDeletion; |
| gfx::Size size; |
| GLenum format; |
| + // TODO: Use a separate sampler object for filter state. |
|
jamesr
2012/11/26 06:54:26
not sure what this means.
in chromium style, TODO
Sami
2012/11/30 17:49:27
In more recent OpenGL versions the sampling state
|
| + GLenum minFilter; |
| + GLenum magFilter; |
|
jamesr
2012/11/26 06:54:26
do we really need to support separate minification
Sami
2012/11/30 17:49:27
For now we only need matching filters so I'll go w
|
| ResourceType type; |
| }; |
| typedef base::hash_map<ResourceId, Resource> ResourceMap; |