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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 fMipMapsDirty = mipMapsDirty; | 48 fMipMapsDirty = mipMapsDirty; |
49 } | 49 } |
50 | 50 |
51 bool mipMapsAreDirty() const { | 51 bool mipMapsAreDirty() const { |
52 return fMipMapsDirty; | 52 return fMipMapsDirty; |
53 } | 53 } |
54 | 54 |
55 /** | 55 /** |
56 * Approximate number of bytes used by the texture | 56 * Approximate number of bytes used by the texture |
57 */ | 57 */ |
58 virtual size_t sizeInBytes() const SK_OVERRIDE { | 58 virtual size_t gpuMemorySize() const SK_OVERRIDE { |
59 return (size_t) fDesc.fWidth * | 59 return (size_t) fDesc.fWidth * |
60 fDesc.fHeight * | 60 fDesc.fHeight * |
61 GrBytesPerPixel(fDesc.fConfig); | 61 GrBytesPerPixel(fDesc.fConfig); |
62 } | 62 } |
63 | 63 |
64 // GrSurface overrides | 64 // GrSurface overrides |
65 virtual bool readPixels(int left, int top, int width, int height, | 65 virtual bool readPixels(int left, int top, int width, int height, |
66 GrPixelConfig config, | 66 GrPixelConfig config, |
67 void* buffer, | 67 void* buffer, |
68 size_t rowBytes = 0, | 68 size_t rowBytes = 0, |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 GrTexture* setTexture(GrTexture* texture) { | 203 GrTexture* setTexture(GrTexture* texture) { |
204 fTexture.reset(SkSafeRef(texture)); | 204 fTexture.reset(SkSafeRef(texture)); |
205 return texture; | 205 return texture; |
206 } | 206 } |
207 private: | 207 private: |
208 SkAutoTUnref<GrTexture> fTexture; | 208 SkAutoTUnref<GrTexture> fTexture; |
209 SkIPoint fOffset; | 209 SkIPoint fOffset; |
210 }; | 210 }; |
211 | 211 |
212 #endif | 212 #endif |
OLD | NEW |