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

Side by Side Diff: cc/test/solid_color_content_layer_client.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 unified diff | Download patch
« no previous file with comments | « cc/test/solid_color_content_layer_client.h ('k') | cc/test/test_context_support.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/solid_color_content_layer_client.h" 5 #include "cc/test/solid_color_content_layer_client.h"
6 6
7 #include "third_party/skia/include/core/SkCanvas.h" 7 #include "third_party/skia/include/core/SkCanvas.h"
8 #include "third_party/skia/include/core/SkPaint.h" 8 #include "third_party/skia/include/core/SkPaint.h"
9 #include "ui/gfx/rect.h" 9 #include "ui/gfx/rect.h"
10 #include "ui/gfx/rect_f.h" 10 #include "ui/gfx/rect_f.h"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 void SolidColorContentLayerClient::PaintContents( 14 void SolidColorContentLayerClient::PaintContents(
15 SkCanvas* canvas, gfx::Rect rect, gfx::RectF* opaque_rect) { 15 SkCanvas* canvas, const gfx::Rect& rect, gfx::RectF* opaque_rect) {
16 SkPaint paint; 16 SkPaint paint;
17 paint.setStyle(SkPaint::kFill_Style); 17 paint.setStyle(SkPaint::kFill_Style);
18 paint.setColor(color_); 18 paint.setColor(color_);
19 19
20 canvas->clear(SK_ColorTRANSPARENT); 20 canvas->clear(SK_ColorTRANSPARENT);
21 canvas->drawRect( 21 canvas->drawRect(
22 SkRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height()), 22 SkRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height()),
23 paint); 23 paint);
24 24
25 if (SkColorGetA(color_) == 255) 25 if (SkColorGetA(color_) == 255)
26 *opaque_rect = rect; 26 *opaque_rect = rect;
27 } 27 }
28 28
29 } // namespace cc 29 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/solid_color_content_layer_client.h ('k') | cc/test/test_context_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698