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

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

Issue 428263003: Intersect SkPictureImageFilter bounds against clip bounds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « no previous file | 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 The Android Open Source Project 2 * Copyright 2013 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 "SkPictureImageFilter.h" 8 #include "SkPictureImageFilter.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 SkBitmap* result, SkIPoint* offset) con st { 62 SkBitmap* result, SkIPoint* offset) con st {
63 if (!fPicture) { 63 if (!fPicture) {
64 offset->fX = offset->fY = 0; 64 offset->fX = offset->fY = 0;
65 return true; 65 return true;
66 } 66 }
67 67
68 SkRect floatBounds; 68 SkRect floatBounds;
69 SkIRect bounds; 69 SkIRect bounds;
70 ctx.ctm().mapRect(&floatBounds, fCropRect); 70 ctx.ctm().mapRect(&floatBounds, fCropRect);
71 floatBounds.roundOut(&bounds); 71 floatBounds.roundOut(&bounds);
72 if (!bounds.intersect(ctx.clipBounds())) {
73 return false;
74 }
72 75
73 if (bounds.isEmpty()) { 76 if (bounds.isEmpty()) {
74 offset->fX = offset->fY = 0; 77 offset->fX = offset->fY = 0;
75 return true; 78 return true;
76 } 79 }
77 80
78 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds .height())); 81 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(bounds.width(), bounds .height()));
79 if (NULL == device.get()) { 82 if (NULL == device.get()) {
80 return false; 83 return false;
81 } 84 }
(...skipping 10 matching lines...) Expand all
92 offset->fY = bounds.fTop; 95 offset->fY = bounds.fTop;
93 return true; 96 return true;
94 } 97 }
95 98
96 bool SkPictureImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ct m, 99 bool SkPictureImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ct m,
97 SkIRect* dst) const { 100 SkIRect* dst) const {
98 *dst = src; 101 *dst = src;
99 return true; 102 return true;
100 } 103 }
101 104
OLDNEW
« no previous file with comments | « no previous file | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698