| 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 "SkImageGenerator.h" | 8 #include "SkImageGenerator.h" |
| 9 #include "SkNextID.h" | 9 #include "SkNextID.h" |
| 10 | 10 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 const SkIRect subset = SkIRect::MakeXYWH(subsetOrigin.x(), subsetOrigin.y(), | 130 const SkIRect subset = SkIRect::MakeXYWH(subsetOrigin.x(), subsetOrigin.y(), |
| 131 subsetPixels.width(), subsetPixels.
height()); | 131 subsetPixels.width(), subsetPixels.
height()); |
| 132 if (!SkIRect::MakeWH(scaledSize.width(), scaledSize.height()).contains(subse
t)) { | 132 if (!SkIRect::MakeWH(scaledSize.width(), scaledSize.height()).contains(subse
t)) { |
| 133 return false; | 133 return false; |
| 134 } | 134 } |
| 135 return this->onGenerateScaledPixels(scaledSize, subsetOrigin, subsetPixels); | 135 return this->onGenerateScaledPixels(scaledSize, subsetOrigin, subsetPixels); |
| 136 } | 136 } |
| 137 | 137 |
| 138 ////////////////////////////////////////////////////////////////////////////////
///////////// | 138 ////////////////////////////////////////////////////////////////////////////////
///////////// |
| 139 | 139 |
| 140 SkData* SkImageGenerator::onRefEncodedData() { | 140 SkData* SkImageGenerator::onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) { |
| 141 return nullptr; | 141 return nullptr; |
| 142 } | 142 } |
| 143 | 143 |
| 144 bool SkImageGenerator::onGetPixels(const SkImageInfo& info, void* dst, size_t rb
, | 144 bool SkImageGenerator::onGetPixels(const SkImageInfo& info, void* dst, size_t rb
, |
| 145 SkPMColor* colors, int* colorCount) { | 145 SkPMColor* colors, int* colorCount) { |
| 146 return false; | 146 return false; |
| 147 } | 147 } |
| 148 | 148 |
| 149 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 149 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 150 | 150 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 if (nullptr == data) { | 238 if (nullptr == data) { |
| 239 return nullptr; | 239 return nullptr; |
| 240 } | 240 } |
| 241 if (gFactory) { | 241 if (gFactory) { |
| 242 if (SkImageGenerator* generator = gFactory(data)) { | 242 if (SkImageGenerator* generator = gFactory(data)) { |
| 243 return generator; | 243 return generator; |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 return SkImageGenerator::NewFromEncodedImpl(data); | 246 return SkImageGenerator::NewFromEncodedImpl(data); |
| 247 } | 247 } |
| OLD | NEW |