| 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 #include "GrImageIDTextureAdjuster.h" | 8 #include "GrImageIDTextureAdjuster.h" |
| 9 | 9 |
| 10 #include "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 void GrBitmapTextureMaker::makeCopyKey(const CopyParams& copyParams, GrUniqueKey
* copyKey) { | 55 void GrBitmapTextureMaker::makeCopyKey(const CopyParams& copyParams, GrUniqueKey
* copyKey) { |
| 56 if (fOriginalKey.isValid()) { | 56 if (fOriginalKey.isValid()) { |
| 57 MakeCopyKeyFromOrigKey(fOriginalKey, copyParams, copyKey); | 57 MakeCopyKeyFromOrigKey(fOriginalKey, copyParams, copyKey); |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 void GrBitmapTextureMaker::didCacheCopy(const GrUniqueKey& copyKey) { | 61 void GrBitmapTextureMaker::didCacheCopy(const GrUniqueKey& copyKey) { |
| 62 GrInstallBitmapUniqueKeyInvalidator(copyKey, fBitmap.pixelRef()); | 62 GrInstallBitmapUniqueKeyInvalidator(copyKey, fBitmap.pixelRef()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 SkAlphaType GrBitmapTextureMaker::alphaType() const { |
| 66 return fBitmap.alphaType(); |
| 67 } |
| 68 |
| 65 SkColorSpace* GrBitmapTextureMaker::getColorSpace() { | 69 SkColorSpace* GrBitmapTextureMaker::getColorSpace() { |
| 66 return fBitmap.colorSpace(); | 70 return fBitmap.colorSpace(); |
| 67 } | 71 } |
| 68 | 72 |
| 69 ////////////////////////////////////////////////////////////////////////////// | 73 ////////////////////////////////////////////////////////////////////////////// |
| 70 static bool cacher_is_alpha_only(const SkImageCacherator& cacher) { | 74 static bool cacher_is_alpha_only(const SkImageCacherator& cacher) { |
| 71 return kAlpha_8_SkColorType == cacher.info().colorType(); | 75 return kAlpha_8_SkColorType == cacher.info().colorType(); |
| 72 } | 76 } |
| 73 GrImageTextureMaker::GrImageTextureMaker(GrContext* context, SkImageCacherator*
cacher, | 77 GrImageTextureMaker::GrImageTextureMaker(GrContext* context, SkImageCacherator*
cacher, |
| 74 const SkImage* client, SkImage::Caching
Hint chint) | 78 const SkImage* client, SkImage::Caching
Hint chint) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 94 MakeCopyKeyFromOrigKey(fOriginalKey, stretch, paramsCopyKey); | 98 MakeCopyKeyFromOrigKey(fOriginalKey, stretch, paramsCopyKey); |
| 95 } | 99 } |
| 96 } | 100 } |
| 97 | 101 |
| 98 void GrImageTextureMaker::didCacheCopy(const GrUniqueKey& copyKey) { | 102 void GrImageTextureMaker::didCacheCopy(const GrUniqueKey& copyKey) { |
| 99 if (fClient) { | 103 if (fClient) { |
| 100 as_IB(fClient)->notifyAddedToCache(); | 104 as_IB(fClient)->notifyAddedToCache(); |
| 101 } | 105 } |
| 102 } | 106 } |
| 103 | 107 |
| 108 SkAlphaType GrImageTextureMaker::alphaType() const { |
| 109 return fCacher->info().alphaType(); |
| 110 } |
| 111 |
| 104 SkColorSpace* GrImageTextureMaker::getColorSpace() { | 112 SkColorSpace* GrImageTextureMaker::getColorSpace() { |
| 105 return fCacher->info().colorSpace(); | 113 return fCacher->info().colorSpace(); |
| 106 } | 114 } |
| OLD | NEW |