213 {
214
215 if (imageSize.
width() > maxTileSize || imageSize.
height() > maxTileSize) {
216 *clippedSubset = determine_clipped_src_rect(conservativeClipBounds, ctm,
217 srcToDst, imageSize, src);
218 *tileSize = determine_tile_size(*clippedSubset, maxTileSize);
219 return true;
220 }
221
222
223 const size_t area = imageSize.
width() * imageSize.
height();
224 if (area < 4 * kBmpSmallTileSize * kBmpSmallTileSize) {
225 return false;
226 }
227
228
229
230
231 if (!cacheSize) {
232
233
234 return false;
235 }
236
237
238 size_t bmpSize = area *
sizeof(
SkPMColor);
239 if (bmpSize < cacheSize / 2) {
240 return false;
241 }
242
243
244
245 *clippedSubset = determine_clipped_src_rect(conservativeClipBounds, ctm,
246 srcToDst, imageSize, src);
247 *tileSize = kBmpSmallTileSize;
248 size_t usedTileBytes = get_tile_count(*clippedSubset, kBmpSmallTileSize) *
249 kBmpSmallTileSize * kBmpSmallTileSize *
251
252 return usedTileBytes * 2 < bmpSize;
253}
constexpr int32_t width() const
constexpr int32_t height() const