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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 virtual const GrRenderTarget* asRenderTarget() const SK_OVERRIDE { | 93 virtual const GrRenderTarget* asRenderTarget() const SK_OVERRIDE { |
94 return fRenderTarget.get(); | 94 return fRenderTarget.get(); |
95 } | 95 } |
96 | 96 |
97 // GrTexture | 97 // GrTexture |
98 /** | 98 /** |
99 * Convert from texels to normalized texture coords for POT textures | 99 * Convert from texels to normalized texture coords for POT textures |
100 * only. | 100 * only. |
101 */ | 101 */ |
102 GrFixed normalizeFixedX(GrFixed x) const { | 102 GrFixed normalizeFixedX(GrFixed x) const { |
103 GrAssert(GrIsPow2(fDesc.fWidth)); | 103 SkASSERT(GrIsPow2(fDesc.fWidth)); |
104 return x >> fShiftFixedX; | 104 return x >> fShiftFixedX; |
105 } | 105 } |
106 GrFixed normalizeFixedY(GrFixed y) const { | 106 GrFixed normalizeFixedY(GrFixed y) const { |
107 GrAssert(GrIsPow2(fDesc.fHeight)); | 107 SkASSERT(GrIsPow2(fDesc.fHeight)); |
108 return y >> fShiftFixedY; | 108 return y >> fShiftFixedY; |
109 } | 109 } |
110 | 110 |
111 /** | 111 /** |
112 * Return the native ID or handle to the texture, depending on the | 112 * Return the native ID or handle to the texture, depending on the |
113 * platform. e.g. on OpenGL, return the texture ID. | 113 * platform. e.g. on OpenGL, return the texture ID. |
114 */ | 114 */ |
115 virtual GrBackendObject getTextureHandle() const = 0; | 115 virtual GrBackendObject getTextureHandle() const = 0; |
116 | 116 |
117 /** | 117 /** |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 GrTexture* setTexture(GrTexture* texture) { | 204 GrTexture* setTexture(GrTexture* texture) { |
205 fTexture.reset(SkSafeRef(texture)); | 205 fTexture.reset(SkSafeRef(texture)); |
206 return texture; | 206 return texture; |
207 } | 207 } |
208 private: | 208 private: |
209 SkAutoTUnref<GrTexture> fTexture; | 209 SkAutoTUnref<GrTexture> fTexture; |
210 SkIPoint fOffset; | 210 SkIPoint fOffset; |
211 }; | 211 }; |
212 | 212 |
213 #endif | 213 #endif |
OLD | NEW |