summaryrefslogtreecommitdiffstats
path: root/skia/ext
diff options
context:
space:
mode:
authorrobertphillips <robertphillips@google.com>2015-01-07 12:01:58 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-07 20:02:34 +0000
commitfb936437f69b402d48faafe8619fb4efb1864a3d (patch)
tree3f4e8cd742e3759e8045354ec46e0ba8614e3881 /skia/ext
parent4a2bfc6a086f61a76637359a5904a58cdc0730a4 (diff)
downloadchromium_src-fb936437f69b402d48faafe8619fb4efb1864a3d.zip
chromium_src-fb936437f69b402d48faafe8619fb4efb1864a3d.tar.gz
chromium_src-fb936437f69b402d48faafe8619fb4efb1864a3d.tar.bz2
Address lingering SkRect::intersect call sites in skia/ext
Skia https://codereview.chromium.org/833943002/ (It is dangerous to ignore SkRect::intersect's return value) will generate a warning when the return value of SkRect::intersect is ignored. This CL cleans up some call sites in skia/ext. Review URL: https://codereview.chromium.org/837243003 Cr-Commit-Position: refs/heads/master@{#310345}
Diffstat (limited to 'skia/ext')
-rw-r--r--skia/ext/pixel_ref_utils.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/skia/ext/pixel_ref_utils.cc b/skia/ext/pixel_ref_utils.cc
index 777c253..7029d46 100644
--- a/skia/ext/pixel_ref_utils.cc
+++ b/skia/ext/pixel_ref_utils.cc
@@ -93,8 +93,8 @@ class GatherPixelRefDevice : public SkBitmapDevice {
if (GetBitmapFromPaint(paint, &bitmap)) {
SkRect mapped_rect;
draw.fMatrix->mapRect(&mapped_rect, rect);
- mapped_rect.intersect(SkRect::Make(draw.fRC->getBounds()));
- AddBitmap(bitmap, mapped_rect);
+ if (mapped_rect.intersect(SkRect::Make(draw.fRC->getBounds())))
+ AddBitmap(bitmap, mapped_rect);
}
}
void drawOval(const SkDraw& draw,
@@ -327,8 +327,8 @@ class GatherPixelRefDevice : public SkBitmapDevice {
void AddBitmap(const SkBitmap& bm, const SkRect& rect) {
SkRect canvas_rect = SkRect::MakeWH(width(), height());
SkRect paint_rect = SkRect::MakeEmpty();
- paint_rect.intersect(rect, canvas_rect);
- pixel_ref_set_->Add(bm.pixelRef(), paint_rect);
+ if (paint_rect.intersect(rect, canvas_rect))
+ pixel_ref_set_->Add(bm.pixelRef(), paint_rect);
}
bool GetBitmapFromPaint(const SkPaint& paint, SkBitmap* bm) {