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

Side by Side Diff: cc/tiles/software_image_decode_cache_perftest.cc

Issue 2857923004: cc: Keep PaintImage in DrawImage. (Closed)
Patch Set: .. Created 3 years, 7 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "cc/base/lap_timer.h" 7 #include "cc/base/lap_timer.h"
8 #include "cc/paint/draw_image.h" 8 #include "cc/paint/draw_image.h"
9 #include "cc/raster/tile_task.h" 9 #include "cc/raster/tile_task.h"
10 #include "cc/tiles/software_image_decode_cache.h" 10 #include "cc/tiles/software_image_decode_cache.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 std::make_pair(1.f, 1.f), std::make_pair(0.5f, 0.5f), 49 std::make_pair(1.f, 1.f), std::make_pair(0.5f, 0.5f),
50 std::make_pair(2.f, 2.f), std::make_pair(0.5f, 1.5f)}; 50 std::make_pair(2.f, 2.f), std::make_pair(0.5f, 1.5f)};
51 51
52 std::vector<DrawImage> images; 52 std::vector<DrawImage> images;
53 for (auto& quality : qualities) { 53 for (auto& quality : qualities) {
54 for (auto& rect_subrect : image_rect_subrect) { 54 for (auto& rect_subrect : image_rect_subrect) {
55 auto& rect = rect_subrect.first; 55 auto& rect = rect_subrect.first;
56 auto& subrect = rect_subrect.second; 56 auto& subrect = rect_subrect.second;
57 for (auto& scale : scales) { 57 for (auto& scale : scales) {
58 images.emplace_back( 58 images.emplace_back(
59 CreateImage(rect.width(), rect.height()), subrect, quality, 59 PaintImage(PaintImage::GetNextId(),
60 CreateImage(rect.width(), rect.height())),
61 subrect, quality,
60 CreateMatrix(SkSize::Make(scale.first, scale.second)), 62 CreateMatrix(SkSize::Make(scale.first, scale.second)),
61 gfx::ColorSpace()); 63 gfx::ColorSpace());
62 } 64 }
63 } 65 }
64 } 66 }
65 67
66 timer_.Reset(); 68 timer_.Reset();
67 do { 69 do {
68 for (auto& image : images) 70 for (auto& image : images)
69 ImageDecodeCacheKey::FromDrawImage(image); 71 ImageDecodeCacheKey::FromDrawImage(image);
70 timer_.NextLap(); 72 timer_.NextLap();
71 } while (!timer_.HasTimeLimitExpired()); 73 } while (!timer_.HasTimeLimitExpired());
72 74
73 perf_test::PrintResult("software_image_decode_cache_fromdrawimage", "", 75 perf_test::PrintResult("software_image_decode_cache_fromdrawimage", "",
74 "result", timer_.LapsPerSecond(), "runs/s", true); 76 "result", timer_.LapsPerSecond(), "runs/s", true);
75 } 77 }
76 78
77 private: 79 private:
78 LapTimer timer_; 80 LapTimer timer_;
79 }; 81 };
80 82
81 TEST_F(SoftwareImageDecodeCachePerfTest, FromDrawImage) { 83 TEST_F(SoftwareImageDecodeCachePerfTest, FromDrawImage) {
82 RunFromImage(); 84 RunFromImage();
83 } 85 }
84 86
85 } // namespace 87 } // namespace
86 } // namespace cc 88 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/software_image_decode_cache.cc ('k') | cc/tiles/software_image_decode_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698