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

Unified Diff: cc/resources/picture.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/resources/picture.h ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture.cc
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc
index f01772b8d48db9c4293b81b0ffb7f8b9919a4e45..bfb905f8a638cadd43f116af59397606b622a83b 100644
--- a/cc/resources/picture.cc
+++ b/cc/resources/picture.cc
@@ -81,11 +81,11 @@ bool DecodeBitmap(const void* buffer, size_t size, SkBitmap* bm) {
} // namespace
-scoped_refptr<Picture> Picture::Create(gfx::Rect layer_rect) {
+scoped_refptr<Picture> Picture::Create(const gfx::Rect& layer_rect) {
return make_scoped_refptr(new Picture(layer_rect));
}
-Picture::Picture(gfx::Rect layer_rect)
+Picture::Picture(const gfx::Rect& layer_rect)
: layer_rect_(layer_rect),
cell_size_(layer_rect.size()) {
// Instead of recording a trace event for object creation here, we wait for
@@ -152,8 +152,8 @@ scoped_refptr<Picture> Picture::CreateFromValue(const base::Value* raw_value) {
}
Picture::Picture(SkPicture* picture,
- gfx::Rect layer_rect,
- gfx::Rect opaque_rect) :
+ const gfx::Rect& layer_rect,
+ const gfx::Rect& opaque_rect) :
layer_rect_(layer_rect),
opaque_rect_(opaque_rect),
picture_(skia::AdoptRef(picture)),
@@ -161,8 +161,8 @@ Picture::Picture(SkPicture* picture,
}
Picture::Picture(const skia::RefPtr<SkPicture>& picture,
- gfx::Rect layer_rect,
- gfx::Rect opaque_rect,
+ const gfx::Rect& layer_rect,
+ const gfx::Rect& opaque_rect,
const PixelRefMap& pixel_refs) :
layer_rect_(layer_rect),
opaque_rect_(opaque_rect),
@@ -385,7 +385,7 @@ Picture::PixelRefIterator::PixelRefIterator()
}
Picture::PixelRefIterator::PixelRefIterator(
- gfx::Rect query_rect,
+ const gfx::Rect& rect,
const Picture* picture)
: picture_(picture),
current_pixel_refs_(empty_pixel_refs_.Pointer()),
@@ -394,6 +394,7 @@ Picture::PixelRefIterator::PixelRefIterator(
gfx::Size cell_size = picture->cell_size_;
DCHECK(!cell_size.IsEmpty());
+ gfx::Rect query_rect(rect);
// Early out if the query rect doesn't intersect this picture.
if (!query_rect.Intersects(layer_rect)) {
min_point_ = gfx::Point(0, 0);
« no previous file with comments | « cc/resources/picture.h ('k') | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698