aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/gpu/GrTexture.h6
-rw-r--r--src/gpu/gl/GrGLTexture.h8
2 files changed, 11 insertions, 3 deletions
diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h
index 17d4e1e40d..1997f68ddf 100644
--- a/include/gpu/GrTexture.h
+++ b/include/gpu/GrTexture.h
@@ -133,6 +133,12 @@ public:
*/
virtual intptr_t getTextureHandle() const = 0;
+ /**
+ * Call this when the state of the native API texture object is
+ * altered directly, without being tracked by skia.
+ */
+ virtual void invalidateCachedState() = 0;
+
#if GR_DEBUG
void validate() const {
this->INHERITED::validate();
diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h
index dd6419eb71..e408e5db94 100644
--- a/src/gpu/gl/GrGLTexture.h
+++ b/src/gpu/gl/GrGLTexture.h
@@ -76,7 +76,9 @@ public:
virtual ~GrGLTexture() { this->release(); }
- virtual intptr_t getTextureHandle() const;
+ virtual intptr_t getTextureHandle() const SK_OVERRIDE;
+
+ virtual void invalidateCachedState() SK_OVERRIDE { fTexParams.invalidate(); }
// these functions
const TexParams& getCachedTexParams(GrGpu::ResetTimestamp* timestamp) const {
@@ -105,8 +107,8 @@ public:
protected:
// overrides of GrTexture
- virtual void onAbandon();
- virtual void onRelease();
+ virtual void onAbandon() SK_OVERRIDE;
+ virtual void onRelease() SK_OVERRIDE;
private:
TexParams fTexParams;