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

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: . 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 "cc/test/fake_picture_pile.h" 10 #include "cc/test/fake_picture_pile.h"
(...skipping 27 matching lines...) Expand all
38 38
39 gfx::Size tiling_size() const { return pile_.GetSize(); } 39 gfx::Size tiling_size() const { return pile_.GetSize(); }
40 gfx::Rect tiling_rect() const { return gfx::Rect(pile_.GetSize()); } 40 gfx::Rect tiling_rect() const { return gfx::Rect(pile_.GetSize()); }
41 41
42 bool UpdateAndExpandInvalidation(Region* invalidation, 42 bool UpdateAndExpandInvalidation(Region* invalidation,
43 const gfx::Size& layer_size, 43 const gfx::Size& layer_size,
44 const gfx::Rect& visible_layer_rect) { 44 const gfx::Rect& visible_layer_rect) {
45 frame_number_++; 45 frame_number_++;
46 return pile_.UpdateAndExpandInvalidation( 46 return pile_.UpdateAndExpandInvalidation(
47 &client_, invalidation, background_color_, contents_opaque_, false, 47 &client_, invalidation, background_color_, contents_opaque_, false,
48 layer_size, visible_layer_rect, frame_number_, 48 false, layer_size, visible_layer_rect, frame_number_,
49 Picture::RECORD_NORMALLY); 49 Picture::RECORD_NORMALLY);
50 } 50 }
51 51
52 bool UpdateWholePile() { 52 bool UpdateWholePile() {
53 Region invalidation = tiling_rect(); 53 Region invalidation = tiling_rect();
54 bool result = UpdateAndExpandInvalidation(&invalidation, tiling_size(), 54 bool result = UpdateAndExpandInvalidation(&invalidation, tiling_size(),
55 tiling_rect()); 55 tiling_rect());
56 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString()); 56 EXPECT_EQ(tiling_rect().ToString(), invalidation.ToString());
57 return result; 57 return result;
58 } 58 }
(...skipping 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 EXPECT_TRUE(pile_.HasRecordings()); 1542 EXPECT_TRUE(pile_.HasRecordings());
1543 pile_.SetEmptyBounds(); 1543 pile_.SetEmptyBounds();
1544 EXPECT_FALSE(pile_.is_solid_color()); 1544 EXPECT_FALSE(pile_.is_solid_color());
1545 EXPECT_TRUE(pile_.GetSize().IsEmpty()); 1545 EXPECT_TRUE(pile_.GetSize().IsEmpty());
1546 EXPECT_TRUE(pile_.picture_map().empty()); 1546 EXPECT_TRUE(pile_.picture_map().empty());
1547 EXPECT_FALSE(pile_.HasRecordings()); 1547 EXPECT_FALSE(pile_.HasRecordings());
1548 } 1548 }
1549 1549
1550 } // namespace 1550 } // namespace
1551 } // namespace cc 1551 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698