| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef GrTexture_DEFINED | 9 #ifndef GrTexture_DEFINED |
| 10 #define GrTexture_DEFINED | 10 #define GrTexture_DEFINED |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 this->INHERITED::validate(); | 39 this->INHERITED::validate(); |
| 40 this->validateDesc(); | 40 this->validateDesc(); |
| 41 } | 41 } |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 /** Access methods that are only to be used within Skia code. */ | 44 /** Access methods that are only to be used within Skia code. */ |
| 45 inline GrTexturePriv texturePriv(); | 45 inline GrTexturePriv texturePriv(); |
| 46 inline const GrTexturePriv texturePriv() const; | 46 inline const GrTexturePriv texturePriv() const; |
| 47 | 47 |
| 48 protected: | 48 protected: |
| 49 GrTexture(GrGpu*, LifeCycle, const GrSurfaceDesc&, GrSLType, bool wasMipMapD
ataProvided); | 49 GrTexture(GrGpu*, SkBudgeted, const GrSurfaceDesc&, GrSLType, bool wasMipMap
DataProvided); |
| 50 | 50 void initScratchKeyIfNeeded(); |
| 51 void validateDesc() const; | 51 void validateDesc() const; |
| 52 | 52 |
| 53 // In protected because subclass GrGLTexture calls this version. |
| 54 size_t onGpuMemorySize() const override; |
| 55 |
| 53 private: | 56 private: |
| 54 size_t onGpuMemorySize() const override; | |
| 55 void dirtyMipMaps(bool mipMapsDirty); | 57 void dirtyMipMaps(bool mipMapsDirty); |
| 56 | 58 |
| 57 enum MipMapsStatus { | 59 enum MipMapsStatus { |
| 58 kNotAllocated_MipMapsStatus, | 60 kNotAllocated_MipMapsStatus, |
| 59 kAllocated_MipMapsStatus, | 61 kAllocated_MipMapsStatus, |
| 60 kValid_MipMapsStatus | 62 kValid_MipMapsStatus |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 GrSLType fSamplerType; | 65 GrSLType fSamplerType; |
| 64 MipMapsStatus fMipMapsStatus; | 66 MipMapsStatus fMipMapsStatus; |
| 65 int fMaxMipMapLevel; | 67 int fMaxMipMapLevel; |
| 66 | 68 |
| 67 friend class GrTexturePriv; | 69 friend class GrTexturePriv; |
| 68 | 70 |
| 69 typedef GrSurface INHERITED; | 71 typedef GrSurface INHERITED; |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 #endif | 74 #endif |
| OLD | NEW |