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

Unified Diff: cc/resource_provider.h

Issue 11358181: Use nearest neighbor filtering for non-translated quads (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Change CHECK() into DCHECK(). 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
« no previous file with comments | « cc/gl_renderer_unittest.cc ('k') | cc/resource_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « cc/gl_renderer_unittest.cc ('k') | cc/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698