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

Unified Diff: include/gpu/GrTexture.h

Issue 13314002: Add support for reading the dst pixel value in an effect. Use in a new effect for the kDarken xfer … (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Revert whitespace/comment changes accidentally made in GrGLProgramDesc.cpp Created 7 years, 9 months 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 | « include/gpu/GrEffect.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTexture.h
===================================================================
--- include/gpu/GrTexture.h (revision 8448)
+++ include/gpu/GrTexture.h (working copy)
@@ -10,6 +10,7 @@
#define GrTexture_DEFINED
#include "GrSurface.h"
+#include "SkPoint.h"
class GrRenderTarget;
class GrResourceKey;
@@ -166,4 +167,42 @@
typedef GrSurface INHERITED;
};
+/**
+ * Represents a texture that is intended to be accessed in device coords with an offset.
+ */
+class GrDeviceCoordTexture {
+public:
+ GrDeviceCoordTexture() { fOffset.set(0, 0); }
+
+ GrDeviceCoordTexture(const GrDeviceCoordTexture& other) {
+ *this = other;
+ }
+
+ GrDeviceCoordTexture(GrTexture* texture, const SkIPoint& offset)
+ : fTexture(SkSafeRef(texture))
+ , fOffset(offset) {
+ }
+
+ GrDeviceCoordTexture& operator=(const GrDeviceCoordTexture& other) {
+ fTexture.reset(SkSafeRef(other.fTexture.get()));
+ fOffset = other.fOffset;
+ return *this;
+ }
+
+ const SkIPoint& offset() const { return fOffset; }
+
+ void setOffset(const SkIPoint& offset) { fOffset = offset; }
+ void setOffset(int ox, int oy) { fOffset.set(ox, oy); }
+
+ GrTexture* texture() const { return fTexture.get(); }
+
+ GrTexture* setTexture(GrTexture* texture) {
+ fTexture.reset(SkSafeRef(texture));
+ return texture;
+ }
+private:
+ SkAutoTUnref<GrTexture> fTexture;
+ SkIPoint fOffset;
+};
+
#endif
« no previous file with comments | « include/gpu/GrEffect.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698