| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 | 8 |
| 9 #ifndef GrGLTexture_DEFINED | 9 #ifndef GrGLTexture_DEFINED |
| 10 #define GrGLTexture_DEFINED | 10 #define GrGLTexture_DEFINED |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 void setCachedTexParams(const TexParams& texParams, | 49 void setCachedTexParams(const TexParams& texParams, |
| 50 GrGpu::ResetTimestamp timestamp) { | 50 GrGpu::ResetTimestamp timestamp) { |
| 51 fTexParams = texParams; | 51 fTexParams = texParams; |
| 52 fTexParamsTimestamp = timestamp; | 52 fTexParamsTimestamp = timestamp; |
| 53 } | 53 } |
| 54 | 54 |
| 55 GrGLuint textureID() const { return fInfo.fID; } | 55 GrGLuint textureID() const { return fInfo.fID; } |
| 56 | 56 |
| 57 GrGLenum target() const { return fInfo.fTarget; } | 57 GrGLenum target() const { return fInfo.fTarget; } |
| 58 | 58 |
| 59 static GrGLTexture* CreateWrapped(GrGLGpu*, const GrSurfaceDesc&, const IDDe
sc&); | 59 static sk_sp<GrGLTexture> MakeWrapped(GrGLGpu*, const GrSurfaceDesc&, const
IDDesc&); |
| 60 protected: | 60 protected: |
| 61 // Constructor for subclasses. | 61 // Constructor for subclasses. |
| 62 GrGLTexture(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&); | 62 GrGLTexture(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&); |
| 63 | 63 |
| 64 enum Wrapped { kWrapped }; | 64 enum Wrapped { kWrapped }; |
| 65 // Constructor for instances wrapping backend objects. | 65 // Constructor for instances wrapping backend objects. |
| 66 GrGLTexture(GrGLGpu*, Wrapped, const GrSurfaceDesc&, const IDDesc&); | 66 GrGLTexture(GrGLGpu*, Wrapped, const GrSurfaceDesc&, const IDDesc&); |
| 67 | 67 |
| 68 void init(const GrSurfaceDesc&, const IDDesc&); | 68 void init(const GrSurfaceDesc&, const IDDesc&); |
| 69 | 69 |
| 70 void onAbandon() override; | 70 void onAbandon() override; |
| 71 void onRelease() override; | 71 void onRelease() override; |
| 72 void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, | 72 void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, |
| 73 const SkString& dumpName) const override; | 73 const SkString& dumpName) const override; |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 TexParams fTexParams; | 76 TexParams fTexParams; |
| 77 GrGpu::ResetTimestamp fTexParamsTimestamp; | 77 GrGpu::ResetTimestamp fTexParamsTimestamp; |
| 78 // Holds the texture target and ID. A pointer to this may be shared to exter
nal clients for | 78 // Holds the texture target and ID. A pointer to this may be shared to exter
nal clients for |
| 79 // direct interaction with the GL object. | 79 // direct interaction with the GL object. |
| 80 GrGLTextureInfo fInfo; | 80 GrGLTextureInfo fInfo; |
| 81 GrBackendObjectOwnership fTextureIDOwnership; | 81 GrBackendObjectOwnership fTextureIDOwnership; |
| 82 | 82 |
| 83 typedef GrTexture INHERITED; | 83 typedef GrTexture INHERITED; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 #endif | 86 #endif |
| OLD | NEW |