| 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 GrImageIDTextureAdjuster_DEFINED | 8 #ifndef GrImageIDTextureAdjuster_DEFINED |
| 9 #define GrImageIDTextureAdjuster_DEFINED | 9 #define GrImageIDTextureAdjuster_DEFINED |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 private: | 38 private: |
| 39 void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override; | 39 void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override; |
| 40 | 40 |
| 41 void didCacheCopy(const GrUniqueKey& copyKey) override; | 41 void didCacheCopy(const GrUniqueKey& copyKey) override; |
| 42 | 42 |
| 43 const SkImage_Base* fImageBase; | 43 const SkImage_Base* fImageBase; |
| 44 | 44 |
| 45 typedef GrTextureAdjuster INHERITED; | 45 typedef GrTextureAdjuster INHERITED; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 /** This class manages the conversion of SW-backed bitmaps to GrTextures. If the
input bitmap is |
| 49 non-volatile the texture is cached using a key created from the pixels' imag
e id and the |
| 50 subset of the pixelref specified by the bitmap. */ |
| 51 class GrBitmapTextureMaker : public GrTextureMaker { |
| 52 public: |
| 53 GrBitmapTextureMaker(GrContext* context, const SkBitmap& bitmap); |
| 54 |
| 55 protected: |
| 56 GrTexture* refOriginalTexture() override; |
| 57 |
| 58 void makeCopyKey(const CopyParams& copyParams, GrUniqueKey* copyKey) overrid
e; |
| 59 |
| 60 void didCacheCopy(const GrUniqueKey& copyKey) override; |
| 61 |
| 62 private: |
| 63 const SkBitmap fBitmap; |
| 64 GrUniqueKey fOriginalKey; |
| 65 |
| 66 typedef GrTextureMaker INHERITED; |
| 67 }; |
| 68 |
| 48 #endif | 69 #endif |
| OLD | NEW |