| Index: cc/resource_provider.h
|
| diff --git a/cc/resource_provider.h b/cc/resource_provider.h
|
| index 3d7b208b01bd69f8367fce2be4041356d9e67512..ba688636e9fbb18a11b80e226f951f4aa121ccce 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 filter for both minification and magnification. The resource
|
| + // must be locked for reading.
|
| + void bindForSampling(ResourceProvider::ResourceId, GLenum target, GLenum filter);
|
| +
|
| // 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 filter);
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(ScopedSamplerGL);
|
| + };
|
| +
|
| class CC_EXPORT ScopedWriteLockGL {
|
| public:
|
| ScopedWriteLockGL(ResourceProvider*, ResourceProvider::ResourceId);
|
| @@ -212,8 +225,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 filter);
|
| + Resource(uint8_t* pixels, int pool, const gfx::Size& size, GLenum format, GLenum filter);
|
|
|
| unsigned glId;
|
| // Pixel buffer used for set pixels without unnecessary copying.
|
| @@ -229,6 +242,8 @@ private:
|
| bool markedForDeletion;
|
| gfx::Size size;
|
| GLenum format;
|
| + // TODO(skyostil): Use a separate sampler object for filter state.
|
| + GLenum filter;
|
| ResourceType type;
|
| };
|
| typedef base::hash_map<ResourceId, Resource> ResourceMap;
|
|
|