Adding API to GrTexture to reset cached texture parameter values

REVIEW=http://codereview.appspot.com/6305084/
BUG=http://code.google.com/p/chromium/issues/detail?id=130925



git-svn-id: http://skia.googlecode.com/svn/trunk@4234 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
junov@chromium.org 2012-06-12 13:58:36 +00:00
parent f6747b0b90
commit 957ebddce1
2 changed files with 11 additions and 3 deletions

View File

@ -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();

View File

@ -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;