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

Side by Side Diff: cc/playback/recording_source_unittest.cc

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: Clean up comments, fix mac build Created 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <vector> 5 #include <vector>
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "cc/base/region.h" 8 #include "cc/base/region.h"
9 #include "cc/playback/raster_source.h" 9 #include "cc/playback/raster_source.h"
10 #include "cc/test/fake_client_picture_cache.h" 10 #include "cc/test/fake_client_picture_cache.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 EXPECT_TRUE(images.empty()); 179 EXPECT_TRUE(images.empty());
180 } 180 }
181 } 181 }
182 182
183 TEST(RecordingSourceTest, NoDiscardableImages) { 183 TEST(RecordingSourceTest, NoDiscardableImages) {
184 gfx::Rect recorded_viewport(0, 0, 256, 256); 184 gfx::Rect recorded_viewport(0, 0, 256, 256);
185 185
186 std::unique_ptr<FakeRecordingSource> recording_source = 186 std::unique_ptr<FakeRecordingSource> recording_source =
187 CreateRecordingSource(recorded_viewport); 187 CreateRecordingSource(recorded_viewport);
188 188
189 SkPaint simple_paint; 189 PaintFlags simple_paint;
190 simple_paint.setColor(SkColorSetARGB(255, 12, 23, 34)); 190 simple_paint.setColor(SkColorSetARGB(255, 12, 23, 34));
191 191
192 SkBitmap non_discardable_bitmap; 192 SkBitmap non_discardable_bitmap;
193 non_discardable_bitmap.allocN32Pixels(128, 128); 193 non_discardable_bitmap.allocN32Pixels(128, 128);
194 non_discardable_bitmap.setImmutable(); 194 non_discardable_bitmap.setImmutable();
195 sk_sp<SkImage> non_discardable_image = 195 sk_sp<SkImage> non_discardable_image =
196 SkImage::MakeFromBitmap(non_discardable_bitmap); 196 SkImage::MakeFromBitmap(non_discardable_bitmap);
197 197
198 recording_source->add_draw_rect_with_paint(gfx::Rect(0, 0, 256, 256), 198 recording_source->add_draw_rect_with_paint(gfx::Rect(0, 0, 256, 256),
199 simple_paint); 199 simple_paint);
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 &images); 365 &images);
366 EXPECT_EQ(3u, images.size()); 366 EXPECT_EQ(3u, images.size());
367 EXPECT_TRUE(images[0].image() == discardable_image[0][0]); 367 EXPECT_TRUE(images[0].image() == discardable_image[0][0]);
368 EXPECT_TRUE(images[1].image() == discardable_image[0][1]); 368 EXPECT_TRUE(images[1].image() == discardable_image[0][1]);
369 EXPECT_TRUE(images[2].image() == discardable_image[1][1]); 369 EXPECT_TRUE(images[2].image() == discardable_image[1][1]);
370 } 370 }
371 } 371 }
372 372
373 } // namespace 373 } // namespace
374 } // namespace cc 374 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698