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

Side by Side Diff: cc/layers/picture_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/picture_layer_impl.cc ('k') | cc/layers/render_surface.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/layers/picture_layer.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include "cc/layers/content_layer_client.h" 7 #include "cc/layers/content_layer_client.h"
8 #include "cc/layers/picture_layer_impl.h" 8 #include "cc/layers/picture_layer_impl.h"
9 #include "cc/resources/resource_update_queue.h" 9 #include "cc/resources/resource_update_queue.h"
10 #include "cc/test/fake_layer_tree_host.h" 10 #include "cc/test/fake_layer_tree_host.h"
11 #include "cc/test/fake_picture_layer_impl.h" 11 #include "cc/test/fake_picture_layer_impl.h"
12 #include "cc/test/fake_proxy.h" 12 #include "cc/test/fake_proxy.h"
13 #include "cc/test/impl_side_painting_settings.h" 13 #include "cc/test/impl_side_painting_settings.h"
14 #include "cc/trees/occlusion_tracker.h" 14 #include "cc/trees/occlusion_tracker.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 namespace cc { 17 namespace cc {
18 namespace { 18 namespace {
19 19
20 class MockContentLayerClient : public ContentLayerClient { 20 class MockContentLayerClient : public ContentLayerClient {
21 public: 21 public:
22 virtual void PaintContents(SkCanvas* canvas, 22 virtual void PaintContents(SkCanvas* canvas,
23 gfx::Rect clip, 23 const gfx::Rect& clip,
24 gfx::RectF* opaque) OVERRIDE {} 24 gfx::RectF* opaque) OVERRIDE {}
25 virtual void DidChangeLayerCanUseLCDText() OVERRIDE {} 25 virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
26 }; 26 };
27 27
28 TEST(PictureLayerTest, NoTilesIfEmptyBounds) { 28 TEST(PictureLayerTest, NoTilesIfEmptyBounds) {
29 MockContentLayerClient client; 29 MockContentLayerClient client;
30 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); 30 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client);
31 layer->SetBounds(gfx::Size(10, 10)); 31 layer->SetBounds(gfx::Size(10, 10));
32 32
33 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); 33 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create();
(...skipping 26 matching lines...) Expand all
60 EXPECT_TRUE(layer_impl->pile()->size() == gfx::Size(0, 0)); 60 EXPECT_TRUE(layer_impl->pile()->size() == gfx::Size(0, 0));
61 EXPECT_TRUE(layer_impl->pile()->recorded_region().IsEmpty()); 61 EXPECT_TRUE(layer_impl->pile()->recorded_region().IsEmpty());
62 } 62 }
63 #ifndef NDEBUG 63 #ifndef NDEBUG
64 proxy.SetCurrentThreadIsImplThread(false); 64 proxy.SetCurrentThreadIsImplThread(false);
65 #endif 65 #endif
66 } 66 }
67 67
68 } // namespace 68 } // namespace
69 } // namespace cc 69 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/render_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698