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

Side by Side Diff: src/effects/SkRectShaderImageFilter.cpp

Issue 1296943002: Implement canComputeFastBounds() for image filters. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Put SkColorFilter::affectsTransparentBlack() back as a non-virtual helper. Created 5 years, 4 months 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 | « src/effects/SkColorFilterImageFilter.cpp ('k') | tests/ImageFilterTest.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 2013 Google Inc. 2 * Copyright 2013 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 "SkRectShaderImageFilter.h" 8 #include "SkRectShaderImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 SkRect rect = SkRect::MakeWH(SkIntToScalar(bounds.width()), SkIntToScalar(bo unds.height())); 73 SkRect rect = SkRect::MakeWH(SkIntToScalar(bounds.width()), SkIntToScalar(bo unds.height()));
74 canvas.drawRect(rect, paint); 74 canvas.drawRect(rect, paint);
75 75
76 *result = device.get()->accessBitmap(false); 76 *result = device.get()->accessBitmap(false);
77 offset->fX = bounds.fLeft; 77 offset->fX = bounds.fLeft;
78 offset->fY = bounds.fTop; 78 offset->fY = bounds.fTop;
79 return true; 79 return true;
80 } 80 }
81 81
82 bool SkRectShaderImageFilter::affectsTransparentBlack() const {
83 return true;
84 }
85
82 #ifndef SK_IGNORE_TO_STRING 86 #ifndef SK_IGNORE_TO_STRING
83 void SkRectShaderImageFilter::toString(SkString* str) const { 87 void SkRectShaderImageFilter::toString(SkString* str) const {
84 str->appendf("SkRectShaderImageFilter: ("); 88 str->appendf("SkRectShaderImageFilter: (");
85 str->append(")"); 89 str->append(")");
86 } 90 }
87 #endif 91 #endif
OLDNEW
« no previous file with comments | « src/effects/SkColorFilterImageFilter.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698