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

Unified Diff: cc/trees/layer_tree_host_pixeltest_masks.cc

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_pixeltest_masks.cc
diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc
index 1d4f893d7d0a844eb684e9651c06c42c0ee5cd69..4e071996edcbe65209106653aa77e42877c616c3 100644
--- a/cc/trees/layer_tree_host_pixeltest_masks.cc
+++ b/cc/trees/layer_tree_host_pixeltest_masks.cc
@@ -17,7 +17,7 @@ namespace {
class LayerTreeHostMasksPixelTest : public LayerTreePixelTest {};
-class MaskContentLayerClient : public cc::ContentLayerClient {
+class MaskContentLayerClient : public ContentLayerClient {
public:
MaskContentLayerClient() {}
virtual ~MaskContentLayerClient() {}
@@ -25,7 +25,7 @@ class MaskContentLayerClient : public cc::ContentLayerClient {
virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
virtual void PaintContents(SkCanvas* canvas,
- gfx::Rect rect,
+ const gfx::Rect& rect,
gfx::RectF* opaque_rect) OVERRIDE {
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);
@@ -33,12 +33,14 @@ class MaskContentLayerClient : public cc::ContentLayerClient {
paint.setColor(SK_ColorWHITE);
canvas->clear(SK_ColorTRANSPARENT);
- while (!rect.IsEmpty()) {
- rect.Inset(3, 3, 2, 2);
+ gfx::Rect inset_rect(rect);
+ while (!inset_rect.IsEmpty()) {
+ inset_rect.Inset(3, 3, 2, 2);
canvas->drawRect(
- SkRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height()),
+ SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(),
+ inset_rect.width(), inset_rect.height()),
paint);
- rect.Inset(3, 3, 2, 2);
+ inset_rect.Inset(3, 3, 2, 2);
}
}
};
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698