OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkBitmapCache.h" | 8 #include "SkBitmapCache.h" |
9 #include "SkRect.h" | 9 #include "SkRect.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 struct BitmapKey : public SkScaledImageCache::Key { | 25 struct BitmapKey : public SkScaledImageCache::Key { |
26 public: | 26 public: |
27 BitmapKey(uint32_t genID, SkScalar scaleX, SkScalar scaleY, const SkIRect& b
ounds) | 27 BitmapKey(uint32_t genID, SkScalar scaleX, SkScalar scaleY, const SkIRect& b
ounds) |
28 : fGenID(genID) | 28 : fGenID(genID) |
29 , fScaleX(scaleX) | 29 , fScaleX(scaleX) |
30 , fScaleY(scaleY) | 30 , fScaleY(scaleY) |
31 , fBounds(bounds) | 31 , fBounds(bounds) |
32 { | 32 { |
33 this->init(sizeof(fGenID) + sizeof(fScaleX) + sizeof(fScaleY) + sizeof(f
Bounds)); | 33 this->init(sizeof(fGenID) + sizeof(fScaleX) + sizeof(fScaleY) + sizeof(f
Bounds)); |
34 } | 34 } |
35 | 35 |
36 uint32_t fGenID; | 36 uint32_t fGenID; |
37 SkScalar fScaleX; | 37 SkScalar fScaleX; |
38 SkScalar fScaleY; | 38 SkScalar fScaleY; |
39 SkIRect fBounds; | 39 SkIRect fBounds; |
40 }; | 40 }; |
41 | 41 |
42 ////////////////////////////////////////////////////////////////////////////////
////////// | 42 ////////////////////////////////////////////////////////////////////////////////
////////// |
43 | 43 |
44 SkScaledImageCache::ID* SkBitmapCache::FindAndLock(const SkBitmap& src, | 44 SkScaledImageCache::ID* SkBitmapCache::FindAndLock(const SkBitmap& src, |
45 SkScalar invScaleX, SkScalar
invScaleY, | 45 SkScalar invScaleX, SkScalar
invScaleY, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 SkScaledImageCache::ID* SkMipMapCache::FindAndLock(const SkBitmap& src, const Sk
MipMap** result) { | 82 SkScaledImageCache::ID* SkMipMapCache::FindAndLock(const SkBitmap& src, const Sk
MipMap** result) { |
83 BitmapKey key(src.getGenerationID(), SK_Scalar1, SK_Scalar1, get_bounds_from
_bitmap(src)); | 83 BitmapKey key(src.getGenerationID(), SK_Scalar1, SK_Scalar1, get_bounds_from
_bitmap(src)); |
84 return SkScaledImageCache::FindAndLock(key, result); | 84 return SkScaledImageCache::FindAndLock(key, result); |
85 } | 85 } |
86 | 86 |
87 SkScaledImageCache::ID* SkMipMapCache::AddAndLock(const SkBitmap& src, const SkM
ipMap* result) { | 87 SkScaledImageCache::ID* SkMipMapCache::AddAndLock(const SkBitmap& src, const SkM
ipMap* result) { |
88 BitmapKey key(src.getGenerationID(), SK_Scalar1, SK_Scalar1, get_bounds_from
_bitmap(src)); | 88 BitmapKey key(src.getGenerationID(), SK_Scalar1, SK_Scalar1, get_bounds_from
_bitmap(src)); |
89 return SkScaledImageCache::AddAndLock(key, result); | 89 return SkScaledImageCache::AddAndLock(key, result); |
90 } | 90 } |
91 | 91 |
OLD | NEW |