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

Side by Side Diff: cc/layers/content_layer_unittest.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/layers/content_layer_client.h ('k') | cc/layers/delegated_frame_provider_unittest.cc » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layers/content_layer.h" 5 #include "cc/layers/content_layer.h"
6 6
7 #include "cc/layers/content_layer_client.h" 7 #include "cc/layers/content_layer_client.h"
8 #include "cc/resources/bitmap_content_layer_updater.h" 8 #include "cc/resources/bitmap_content_layer_updater.h"
9 #include "cc/test/fake_rendering_stats_instrumentation.h" 9 #include "cc/test/fake_rendering_stats_instrumentation.h"
10 #include "cc/test/geometry_test_utils.h" 10 #include "cc/test/geometry_test_utils.h"
11 #include "skia/ext/platform_canvas.h" 11 #include "skia/ext/platform_canvas.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "ui/gfx/rect_conversions.h" 13 #include "ui/gfx/rect_conversions.h"
14 14
15 namespace cc { 15 namespace cc {
16 namespace { 16 namespace {
17 17
18 class MockContentLayerClient : public ContentLayerClient { 18 class MockContentLayerClient : public ContentLayerClient {
19 public: 19 public:
20 explicit MockContentLayerClient(gfx::Rect opaque_layer_rect) 20 explicit MockContentLayerClient(const gfx::Rect& opaque_layer_rect)
21 : opaque_layer_rect_(opaque_layer_rect) {} 21 : opaque_layer_rect_(opaque_layer_rect) {}
22 22
23 virtual void PaintContents(SkCanvas* canvas, 23 virtual void PaintContents(SkCanvas* canvas,
24 gfx::Rect clip, 24 const gfx::Rect& clip,
25 gfx::RectF* opaque) OVERRIDE { 25 gfx::RectF* opaque) OVERRIDE {
26 *opaque = gfx::RectF(opaque_layer_rect_); 26 *opaque = gfx::RectF(opaque_layer_rect_);
27 } 27 }
28 virtual void DidChangeLayerCanUseLCDText() OVERRIDE {} 28 virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
29 29
30 private: 30 private:
31 gfx::Rect opaque_layer_rect_; 31 gfx::Rect opaque_layer_rect_;
32 }; 32 };
33 33
34 TEST(ContentLayerTest, ContentLayerPainterWithDeviceScale) { 34 TEST(ContentLayerTest, ContentLayerPainterWithDeviceScale) {
(...skipping 16 matching lines...) Expand all
51 contents_scale, 51 contents_scale,
52 contents_scale, 52 contents_scale,
53 &resulting_opaque_rect); 53 &resulting_opaque_rect);
54 54
55 EXPECT_EQ(opaque_rect_in_content_space.ToString(), 55 EXPECT_EQ(opaque_rect_in_content_space.ToString(),
56 resulting_opaque_rect.ToString()); 56 resulting_opaque_rect.ToString());
57 } 57 }
58 58
59 } // namespace 59 } // namespace
60 } // namespace cc 60 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/content_layer_client.h ('k') | cc/layers/delegated_frame_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698