OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 "SkImageFilter.h" | 8 #include "SkImageFilter.h" |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 | 100 |
101 uint32_t flags = buffer.readUInt(); | 101 uint32_t flags = buffer.readUInt(); |
102 fCropRect = CropRect(rect, flags); | 102 fCropRect = CropRect(rect, flags); |
103 fUniqueID = buffer.readUInt(); | 103 fUniqueID = buffer.readUInt(); |
104 return buffer.isValid(); | 104 return buffer.isValid(); |
105 } | 105 } |
106 | 106 |
107 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 107 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
108 | 108 |
109 SkImageFilter::SkImageFilter(int inputCount, SkImageFilter** inputs, const CropR
ect* cropRect, uint32_t uniqueID) | 109 SkImageFilter::SkImageFilter(int inputCount, SkImageFilter** inputs, const CropR
ect* cropRect) |
110 : fInputCount(inputCount), | 110 : fInputCount(inputCount), |
111 fInputs(new SkImageFilter*[inputCount]), | 111 fInputs(new SkImageFilter*[inputCount]), |
112 fUsesSrcInput(false), | 112 fUsesSrcInput(false), |
113 fCropRect(cropRect ? *cropRect : CropRect(SkRect(), 0x0)), | 113 fCropRect(cropRect ? *cropRect : CropRect(SkRect(), 0x0)), |
114 fUniqueID(uniqueID ? uniqueID : next_image_filter_unique_id()) { | 114 fUniqueID(next_image_filter_unique_id()) { |
115 for (int i = 0; i < inputCount; ++i) { | 115 for (int i = 0; i < inputCount; ++i) { |
116 if (NULL == inputs[i] || inputs[i]->usesSrcInput()) { | 116 if (NULL == inputs[i] || inputs[i]->usesSrcInput()) { |
117 fUsesSrcInput = true; | 117 fUsesSrcInput = true; |
118 } | 118 } |
119 fInputs[i] = inputs[i]; | 119 fInputs[i] = inputs[i]; |
120 SkSafeRef(fInputs[i]); | 120 SkSafeRef(fInputs[i]); |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 SkImageFilter::~SkImageFilter() { | 124 SkImageFilter::~SkImageFilter() { |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 485 |
486 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) { | 486 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) { |
487 return SkNEW_ARGS(CacheImpl, (maxBytes)); | 487 return SkNEW_ARGS(CacheImpl, (maxBytes)); |
488 } | 488 } |
489 | 489 |
490 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache); | 490 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache); |
491 | 491 |
492 SkImageFilter::Cache* SkImageFilter::Cache::Get() { | 492 SkImageFilter::Cache* SkImageFilter::Cache::Get() { |
493 return cache.get(); | 493 return cache.get(); |
494 } | 494 } |
OLD | NEW |