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 |
11 | 11 |
12 #include "GrSurface.h" | 12 #include "GrSurface.h" |
13 #include "SkPoint.h" | 13 #include "SkPoint.h" |
14 #include "SkRefCnt.h" | 14 #include "SkRefCnt.h" |
15 | 15 |
16 class GrTextureParams; | 16 class GrTextureParams; |
17 class GrTexturePriv; | 17 class GrTexturePriv; |
18 | 18 |
19 class GrTexture : virtual public GrSurface { | 19 class GrTexture : virtual public GrSurface { |
20 public: | 20 public: |
21 GrTexture* asTexture() override { return this; } | 21 GrTexture* asTexture() override { return this; } |
22 const GrTexture* asTexture() const override { return this; } | 22 const GrTexture* asTexture() const override { return this; } |
23 GrSLType samplerType() const { return fSamplerType; } | 23 GrSLType samplerType() const { return fSamplerType; } |
24 | 24 |
25 /** | 25 /** |
| 26 * Returns true if the classic texturing options found in GrTextureParams ar
e applicable for |
| 27 * this texture. These may not apply for nonstandard types of textures (e.g.
buffer texture). |
| 28 */ |
| 29 bool supportsTextureParams() const { return kSamplerBuffer_GrSLType != fSamp
lerType; } |
| 30 |
| 31 /** |
26 * Return the native ID or handle to the texture, depending on the | 32 * Return the native ID or handle to the texture, depending on the |
27 * platform. e.g. on OpenGL, return the texture ID. | 33 * platform. e.g. on OpenGL, return the texture ID. |
28 */ | 34 */ |
29 virtual GrBackendObject getTextureHandle() const = 0; | 35 virtual GrBackendObject getTextureHandle() const = 0; |
30 | 36 |
31 /** | 37 /** |
32 * This function indicates that the texture parameters (wrap mode, filtering
, ...) have been | 38 * This function indicates that the texture parameters (wrap mode, filtering
, ...) have been |
33 * changed externally to Skia. | 39 * changed externally to Skia. |
34 */ | 40 */ |
35 virtual void textureParamsModified() = 0; | 41 virtual void textureParamsModified() = 0; |
(...skipping 27 matching lines...) Expand all Loading... |
63 GrSLType fSamplerType; | 69 GrSLType fSamplerType; |
64 MipMapsStatus fMipMapsStatus; | 70 MipMapsStatus fMipMapsStatus; |
65 int fMaxMipMapLevel; | 71 int fMaxMipMapLevel; |
66 | 72 |
67 friend class GrTexturePriv; | 73 friend class GrTexturePriv; |
68 | 74 |
69 typedef GrSurface INHERITED; | 75 typedef GrSurface INHERITED; |
70 }; | 76 }; |
71 | 77 |
72 #endif | 78 #endif |
OLD | NEW |