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

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

Issue 25284005: cc: Add best_record_time to rendering stats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 2 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/resources/picture_pile.cc ('k') | cc/resources/picture_unittest.cc » ('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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "cc/test/fake_picture_pile_impl.h" 6 #include "cc/test/fake_picture_pile_impl.h"
7 #include "cc/test/fake_rendering_stats_instrumentation.h" 7 #include "cc/test/fake_rendering_stats_instrumentation.h"
8 #include "cc/test/skia_common.h" 8 #include "cc/test/skia_common.h"
9 #include "skia/ext/lazy_pixel_ref.h" 9 #include "skia/ext/lazy_pixel_ref.h"
10 #include "skia/ext/refptr.h" 10 #include "skia/ext/refptr.h"
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 for (int x = 0; x < 2; ++x) { 671 for (int x = 0; x < 2; ++x) {
672 if (x == 0 && y == 1) 672 if (x == 0 && y == 1)
673 continue; 673 continue;
674 content_layer_clients[y][x].add_draw_bitmap( 674 content_layer_clients[y][x].add_draw_bitmap(
675 lazy_bitmap[y][x], 675 lazy_bitmap[y][x],
676 gfx::Point(x * 128 + 10, y * 128 + 10)); 676 gfx::Point(x * 128 + 10, y * 128 + 10));
677 pictures[y][x] = Picture::Create( 677 pictures[y][x] = Picture::Create(
678 gfx::Rect(x * 128 + 10, y * 128 + 10, 64, 64)); 678 gfx::Rect(x * 128 + 10, y * 128 + 10, 64, 64));
679 pictures[y][x]->Record( 679 pictures[y][x]->Record(
680 &content_layer_clients[y][x], 680 &content_layer_clients[y][x],
681 tile_grid_info, 681 tile_grid_info);
682 &stats_instrumentation);
683 pictures[y][x]->GatherPixelRefs(tile_grid_info, &stats_instrumentation); 682 pictures[y][x]->GatherPixelRefs(tile_grid_info, &stats_instrumentation);
684 pile->AddPictureToRecording(0, 0, pictures[y][x]); 683 pile->AddPictureToRecording(0, 0, pictures[y][x]);
685 } 684 }
686 } 685 }
687 686
688 // These should find only one pixel ref. 687 // These should find only one pixel ref.
689 { 688 {
690 PicturePileImpl::PixelRefIterator iterator( 689 PicturePileImpl::PixelRefIterator iterator(
691 gfx::Rect(0, 0, 128, 128), 1.0, pile.get()); 690 gfx::Rect(0, 0, 128, 128), 1.0, pile.get());
692 EXPECT_TRUE(iterator); 691 EXPECT_TRUE(iterator);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 790
792 SkColor* pixels = reinterpret_cast<SkColor*>(bitmap.getPixels()); 791 SkColor* pixels = reinterpret_cast<SkColor*>(bitmap.getPixels());
793 int num_pixels = bitmap.width() * bitmap.height(); 792 int num_pixels = bitmap.width() * bitmap.height();
794 for (int i = 0; i < num_pixels; ++i) { 793 for (int i = 0; i < num_pixels; ++i) {
795 EXPECT_EQ(SkColorGetA(pixels[i]), 0u); 794 EXPECT_EQ(SkColorGetA(pixels[i]), 0u);
796 } 795 }
797 } 796 }
798 797
799 } // namespace 798 } // namespace
800 } // namespace cc 799 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_pile.cc ('k') | cc/resources/picture_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698