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 29 matching lines...) Expand all Loading... |
40 virtual GrTexture* asTexture() SK_OVERRIDE { return this; } | 40 virtual GrTexture* asTexture() SK_OVERRIDE { return this; } |
41 virtual const GrTexture* asTexture() const SK_OVERRIDE { return this; } | 41 virtual const GrTexture* asTexture() const SK_OVERRIDE { return this; } |
42 virtual GrRenderTarget* asRenderTarget() SK_OVERRIDE { return fRenderTarget.
get(); } | 42 virtual GrRenderTarget* asRenderTarget() SK_OVERRIDE { return fRenderTarget.
get(); } |
43 virtual const GrRenderTarget* asRenderTarget() const SK_OVERRIDE { return fR
enderTarget.get(); } | 43 virtual const GrRenderTarget* asRenderTarget() const SK_OVERRIDE { return fR
enderTarget.get(); } |
44 | 44 |
45 /** | 45 /** |
46 * Convert from texels to normalized texture coords for POT textures only. P
lease don't add | 46 * Convert from texels to normalized texture coords for POT textures only. P
lease don't add |
47 * new callsites for these functions. They are slated for removal. | 47 * new callsites for these functions. They are slated for removal. |
48 */ | 48 */ |
49 SkFixed normalizeFixedX(SkFixed x) const { | 49 SkFixed normalizeFixedX(SkFixed x) const { |
50 SkASSERT(GrIsPow2(fDesc.fWidth)); | 50 SkASSERT(SkIsPow2(fDesc.fWidth)); |
51 return x >> fShiftFixedX; | 51 return x >> fShiftFixedX; |
52 } | 52 } |
53 SkFixed normalizeFixedY(SkFixed y) const { | 53 SkFixed normalizeFixedY(SkFixed y) const { |
54 SkASSERT(GrIsPow2(fDesc.fHeight)); | 54 SkASSERT(SkIsPow2(fDesc.fHeight)); |
55 return y >> fShiftFixedY; | 55 return y >> fShiftFixedY; |
56 } | 56 } |
57 | 57 |
58 /** | 58 /** |
59 * Return the native ID or handle to the texture, depending on the | 59 * Return the native ID or handle to the texture, depending on the |
60 * platform. e.g. on OpenGL, return the texture ID. | 60 * platform. e.g. on OpenGL, return the texture ID. |
61 */ | 61 */ |
62 virtual GrBackendObject getTextureHandle() const = 0; | 62 virtual GrBackendObject getTextureHandle() const = 0; |
63 | 63 |
64 /** | 64 /** |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 fTexture.reset(SkSafeRef(texture)); | 212 fTexture.reset(SkSafeRef(texture)); |
213 return texture; | 213 return texture; |
214 } | 214 } |
215 | 215 |
216 private: | 216 private: |
217 SkAutoTUnref<GrTexture> fTexture; | 217 SkAutoTUnref<GrTexture> fTexture; |
218 SkIPoint fOffset; | 218 SkIPoint fOffset; |
219 }; | 219 }; |
220 | 220 |
221 #endif | 221 #endif |
OLD | NEW |