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

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: Associate resources with min/mag filters and use NEAREST for tile quads when feasible. Created 8 years, 1 month 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 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;
« cc/gl_renderer.cc ('K') | « 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