| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #ifndef GrTextureMaker_DEFINED | 8 #ifndef GrTextureMaker_DEFINED |
| 9 #define GrTextureMaker_DEFINED | 9 #define GrTextureMaker_DEFINED |
| 10 | 10 |
| 11 #include "SkGrPriv.h" | 11 #include "SkGrPriv.h" |
| 12 | 12 |
| 13 class GrContext; | 13 class GrContext; |
| 14 class GrTexture; | 14 class GrTexture; |
| 15 class GrTextureParams; | 15 class GrTextureParams; |
| 16 class GrUniqueKey; | 16 class GrUniqueKey; |
| 17 class SkBitmap; | 17 class SkBitmap; |
| 18 | 18 |
| 19 class GrTextureMaker { | 19 class GrTextureMaker { |
| 20 public: | 20 public: |
| 21 GrTextureMaker(int width, int height) : fWidth(width), fHeight(height) {} | 21 GrTextureMaker(int width, int height) : fWidth(width), fHeight(height) {} |
| 22 virtual ~GrTextureMaker() {} | 22 virtual ~GrTextureMaker() {} |
| 23 | 23 |
| 24 int width() const { return fWidth; } | 24 int width() const { return fWidth; } |
| 25 int height() const { return fHeight; } | 25 int height() const { return fHeight; } |
| 26 | 26 |
| 27 GrTexture* refCachedTexture(GrContext*, SkImageUsageType); | 27 GrTexture* refCachedTexture(GrContext*, const GrTextureParams&); |
| 28 GrTexture* refCachedTexture(GrContext*, const GrTextureParams*); | |
| 29 | 28 |
| 30 protected: | 29 protected: |
| 31 /** | 30 /** |
| 32 * Return the maker's "original" unstretched texture. It is the responsibil
ity of the maker | 31 * Return the maker's "original" unstretched texture. It is the responsibil
ity of the maker |
| 33 * to make this efficient ... if the texture is being generated, the maker
must handle | 32 * to make this efficient ... if the texture is being generated, the maker
must handle |
| 34 * caching it. | 33 * caching it. |
| 35 */ | 34 */ |
| 36 virtual GrTexture* onRefUnstretchedTexture(GrContext*) = 0; | 35 virtual GrTexture* onRefUnstretchedTexture(GrContext*) = 0; |
| 37 | 36 |
| 38 /** | 37 /** |
| (...skipping 29 matching lines...) Expand all Loading... |
| 68 * of the original texture. | 67 * of the original texture. |
| 69 */ | 68 */ |
| 70 virtual bool onGetROBitmap(SkBitmap*) = 0; | 69 virtual bool onGetROBitmap(SkBitmap*) = 0; |
| 71 | 70 |
| 72 private: | 71 private: |
| 73 const int fWidth; | 72 const int fWidth; |
| 74 const int fHeight; | 73 const int fHeight; |
| 75 }; | 74 }; |
| 76 | 75 |
| 77 #endif | 76 #endif |
| OLD | NEW |