Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/core/SkImageFilter.cpp

Issue 678273002: Revert of Fix bounds computation of all 0-input filters. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/effects/SkPictureImageFilter.h ('k') | src/effects/SkBitmapSource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 canvas.drawBitmap(src, srcOffset->x() - bounds->x(), srcOffset->y() - bo unds->y()); 335 canvas.drawBitmap(src, srcOffset->x() - bounds->x(), srcOffset->y() - bo unds->y());
336 *srcOffset = SkIPoint::Make(bounds->x(), bounds->y()); 336 *srcOffset = SkIPoint::Make(bounds->x(), bounds->y());
337 *dst = device->accessBitmap(false); 337 *dst = device->accessBitmap(false);
338 return true; 338 return true;
339 } 339 }
340 } 340 }
341 341
342 bool SkImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, 342 bool SkImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
343 SkIRect* dst) const { 343 SkIRect* dst) const {
344 if (fInputCount < 1) { 344 if (fInputCount < 1) {
345 *dst = src; 345 return false;
346 return true;
347 } 346 }
348 347
349 SkIRect bounds; 348 SkIRect bounds;
350 for (int i = 0; i < fInputCount; ++i) { 349 for (int i = 0; i < fInputCount; ++i) {
351 SkImageFilter* filter = this->getInput(i); 350 SkImageFilter* filter = this->getInput(i);
352 SkIRect rect = src; 351 SkIRect rect = src;
353 if (filter && !filter->filterBounds(src, ctm, &rect)) { 352 if (filter && !filter->filterBounds(src, ctm, &rect)) {
354 return false; 353 return false;
355 } 354 }
356 if (0 == i) { 355 if (0 == i) {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 493
495 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) { 494 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) {
496 return SkNEW_ARGS(CacheImpl, (maxBytes)); 495 return SkNEW_ARGS(CacheImpl, (maxBytes));
497 } 496 }
498 497
499 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache); 498 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache);
500 499
501 SkImageFilter::Cache* SkImageFilter::Cache::Get() { 500 SkImageFilter::Cache* SkImageFilter::Cache::Get() {
502 return cache.get(); 501 return cache.get();
503 } 502 }
OLDNEW
« no previous file with comments | « include/effects/SkPictureImageFilter.h ('k') | src/effects/SkBitmapSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698