OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2015 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef GrImageIDTextureAdjuster_DEFINED |
| 9 #define GrImageIDTextureAdjuster_DEFINED |
| 10 |
| 11 #include "GrTextureParamsAdjuster.h" |
| 12 |
| 13 class SkBitmap; |
| 14 class SkImage_Base; |
| 15 |
| 16 /** Implementation for texture-backed SkBitmaps. The bitmap must stay in scope a
nd unmodified |
| 17 while this object exists. */ |
| 18 class GrBitmapTextureAdjuster : public GrTextureAdjuster { |
| 19 public: |
| 20 explicit GrBitmapTextureAdjuster(const SkBitmap* bmp); |
| 21 |
| 22 private: |
| 23 void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override; |
| 24 |
| 25 void didCacheCopy(const GrUniqueKey& copyKey) override; |
| 26 |
| 27 const SkBitmap* fBmp; |
| 28 |
| 29 typedef GrTextureAdjuster INHERITED; |
| 30 }; |
| 31 |
| 32 /** Implementation for texture-backed SkImages. The image must stay in scope and
unmodified while |
| 33 this object exists. */ |
| 34 class GrImageTextureAdjuster : public GrTextureAdjuster { |
| 35 public: |
| 36 explicit GrImageTextureAdjuster(const SkImage_Base* img); |
| 37 |
| 38 private: |
| 39 void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override; |
| 40 |
| 41 void didCacheCopy(const GrUniqueKey& copyKey) override; |
| 42 |
| 43 const SkImage_Base* fImageBase; |
| 44 |
| 45 typedef GrTextureAdjuster INHERITED; |
| 46 }; |
| 47 |
| 48 #endif |
OLD | NEW |