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

Side by Side Diff: cc/resources/picture_pile_unittest.cc

Issue 684543006: cc: Toggle LCD text at raster time instead of record time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcdraster: bettertestsyay Created 6 years, 1 month 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
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 <map> 5 #include <map>
6 #include <utility> 6 #include <utility>
7 7
8 #include "cc/resources/picture_pile.h" 8 #include "cc/resources/picture_pile.h"
9 #include "cc/test/fake_content_layer_client.h" 9 #include "cc/test/fake_content_layer_client.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 gfx::Size tiling_size() const { return pile_.tiling_size(); } 63 gfx::Size tiling_size() const { return pile_.tiling_size(); }
64 gfx::Rect tiling_rect() const { return gfx::Rect(pile_.tiling_size()); } 64 gfx::Rect tiling_rect() const { return gfx::Rect(pile_.tiling_size()); }
65 65
66 bool UpdateAndExpandInvalidation(Region* invalidation, 66 bool UpdateAndExpandInvalidation(Region* invalidation,
67 const gfx::Size& layer_size, 67 const gfx::Size& layer_size,
68 const gfx::Rect& visible_layer_rect) { 68 const gfx::Rect& visible_layer_rect) {
69 frame_number_++; 69 frame_number_++;
70 return pile_.UpdateAndExpandInvalidation( 70 return pile_.UpdateAndExpandInvalidation(
71 &client_, invalidation, background_color_, contents_opaque_, false, 71 &client_, invalidation, background_color_, contents_opaque_, false,
72 layer_size, visible_layer_rect, frame_number_, 72 false, layer_size, visible_layer_rect, frame_number_,
73 Picture::RECORD_NORMALLY); 73 Picture::RECORD_NORMALLY);
74 } 74 }
75 75
76 bool UpdateWholePile() { 76 bool UpdateWholePile() {
77 Region invalidation = tiling_rect(); 77 Region invalidation = tiling_rect();
78 bool result = UpdateAndExpandInvalidation( 78 bool result = UpdateAndExpandInvalidation(
79 &invalidation, tiling_size(), tiling_rect()); 79 &invalidation, tiling_size(), tiling_rect());
80 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString()); 80 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString());
81 return result; 81 return result;
82 } 82 }
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
1460 EXPECT_TRUE(pile_.HasRecordings()); 1460 EXPECT_TRUE(pile_.HasRecordings());
1461 pile_.SetEmptyBounds(); 1461 pile_.SetEmptyBounds();
1462 EXPECT_FALSE(pile_.is_solid_color()); 1462 EXPECT_FALSE(pile_.is_solid_color());
1463 EXPECT_TRUE(pile_.tiling_size().IsEmpty()); 1463 EXPECT_TRUE(pile_.tiling_size().IsEmpty());
1464 EXPECT_TRUE(pile_.picture_map().empty()); 1464 EXPECT_TRUE(pile_.picture_map().empty());
1465 EXPECT_FALSE(pile_.HasRecordings()); 1465 EXPECT_FALSE(pile_.HasRecordings());
1466 } 1466 }
1467 1467
1468 } // namespace 1468 } // namespace
1469 } // namespace cc 1469 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698