Chromium Code Reviews| Index: include/gpu/GrTexture.h |
| diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h |
| index 1b9f7b75017adb0190ff9f503baa0ca12e9240cf..1df91e6fc8bb52a0829904859cb2a6cdc21c406a 100644 |
| --- a/include/gpu/GrTexture.h |
| +++ b/include/gpu/GrTexture.h |
| @@ -44,22 +44,16 @@ public: |
| return 0 != (fDesc.fFlags & flags); |
| } |
| - void dirtyMipMaps(bool mipMapsDirty) { |
| - fMipMapsDirty = mipMapsDirty; |
| - } |
| + void dirtyMipMaps(bool mipMapsDirty); |
|
robertphillips
2014/04/29 13:46:25
I don't think we need to change this in this CL bu
Chris Dalton
2014/04/30 16:47:39
Corect. I was going for minimal change -- keep the
robertphillips
2014/04/30 17:31:49
Nope - I think this is moving in the right directi
|
| bool mipMapsAreDirty() const { |
| - return fMipMapsDirty; |
| + return kValid_MipMapsStatus != fMipMapsStatus; |
| } |
| /** |
| * Approximate number of bytes used by the texture |
| */ |
| - virtual size_t gpuMemorySize() const SK_OVERRIDE { |
| - return (size_t) fDesc.fWidth * |
| - fDesc.fHeight * |
| - GrBytesPerPixel(fDesc.fConfig); |
| - } |
| + virtual size_t gpuMemorySize() const SK_OVERRIDE; |
| // GrSurface overrides |
| virtual bool readPixels(int left, int top, int width, int height, |
| @@ -144,7 +138,7 @@ protected: |
| GrTexture(GrGpu* gpu, bool isWrapped, const GrTextureDesc& desc) |
| : INHERITED(gpu, isWrapped, desc) |
| , fRenderTarget(NULL) |
| - , fMipMapsDirty(true) { |
| + , fMipMapsStatus(kNotAllocated_MipMapsStatus) { |
| // only make sense if alloc size is pow2 |
| fShiftFixedX = 31 - SkCLZ(fDesc.fWidth); |
| @@ -159,12 +153,18 @@ protected: |
| void validateDesc() const; |
| private: |
| + enum MipMapsStatus { |
| + kNotAllocated_MipMapsStatus, |
|
robertphillips
2014/04/29 13:46:25
// allocated but dirty
|
| + kInvalid_MipMapsStatus, |
| + kValid_MipMapsStatus |
| + }; |
| + |
| // these two shift a fixed-point value into normalized coordinates |
| // for this texture if the texture is power of two sized. |
| int fShiftFixedX; |
| int fShiftFixedY; |
| - bool fMipMapsDirty; |
| + MipMapsStatus fMipMapsStatus; |
| virtual void internal_dispose() const SK_OVERRIDE; |