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

Side by Side Diff: cc/test/fake_picture_pile_impl.cc

Issue 14230007: cc: Do GatherPixelRefs from skia at record time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile fix Created 7 years, 8 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/fake_picture_pile_impl.h ('k') | no next file » | 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/fake_picture_pile_impl.h" 5 #include "cc/test/fake_picture_pile_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "cc/test/impl_side_painting_settings.h" 9 #include "cc/test/impl_side_painting_settings.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return; 52 return;
53 gfx::Rect bounds(tiling().TileBounds(x, y)); 53 gfx::Rect bounds(tiling().TileBounds(x, y));
54 scoped_refptr<Picture> picture(Picture::Create(bounds)); 54 scoped_refptr<Picture> picture(Picture::Create(bounds));
55 picture->Record(&client_, NULL, tile_grid_info_); 55 picture->Record(&client_, NULL, tile_grid_info_);
56 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); 56 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture);
57 EXPECT_TRUE(HasRecordingAt(x, y)); 57 EXPECT_TRUE(HasRecordingAt(x, y));
58 58
59 UpdateRecordedRegion(); 59 UpdateRecordedRegion();
60 } 60 }
61 61
62 void FakePicturePileImpl::AddPictureToRecording(
63 int x,
64 int y,
65 scoped_refptr<Picture> picture) {
66 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture);
67 }
68
62 void FakePicturePileImpl::RemoveRecordingAt(int x, int y) { 69 void FakePicturePileImpl::RemoveRecordingAt(int x, int y) {
63 EXPECT_GE(x, 0); 70 EXPECT_GE(x, 0);
64 EXPECT_GE(y, 0); 71 EXPECT_GE(y, 0);
65 EXPECT_LT(x, tiling_.num_tiles_x()); 72 EXPECT_LT(x, tiling_.num_tiles_x());
66 EXPECT_LT(y, tiling_.num_tiles_y()); 73 EXPECT_LT(y, tiling_.num_tiles_y());
67 74
68 if (!HasRecordingAt(x, y)) 75 if (!HasRecordingAt(x, y))
69 return; 76 return;
70 picture_list_map_.erase(std::pair<int, int>(x, y)); 77 picture_list_map_.erase(std::pair<int, int>(x, y));
71 EXPECT_FALSE(HasRecordingAt(x, y)); 78 EXPECT_FALSE(HasRecordingAt(x, y));
72 79
73 UpdateRecordedRegion(); 80 UpdateRecordedRegion();
74 } 81 }
75 82
76 } // namespace cc 83 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_picture_pile_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698