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

Unified Diff: cc/resources/picture_pile_impl_perftest.cc

Issue 1144693002: cc: Move files out of cc/resources/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resources: android Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/picture_pile_impl.cc ('k') | cc/resources/picture_pile_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile_impl_perftest.cc
diff --git a/cc/resources/picture_pile_impl_perftest.cc b/cc/resources/picture_pile_impl_perftest.cc
deleted file mode 100644
index 7e24724197cdfdca559b4b5518b719aef307e265..0000000000000000000000000000000000000000
--- a/cc/resources/picture_pile_impl_perftest.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "cc/resources/picture_pile_impl.h"
-
-#include "cc/debug/lap_timer.h"
-#include "cc/test/fake_picture_pile_impl.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/perf/perf_test.h"
-
-namespace cc {
-namespace {
-
-const int kTimeLimitMillis = 2000;
-const int kWarmupRuns = 5;
-const int kTimeCheckInterval = 10;
-
-const int kTileSize = 100;
-const int kLayerSize = 1000;
-
-class PicturePileImplPerfTest : public testing::Test {
- public:
- PicturePileImplPerfTest()
- : timer_(kWarmupRuns,
- base::TimeDelta::FromMilliseconds(kTimeLimitMillis),
- kTimeCheckInterval) {}
-
- void RunAnalyzeTest(const std::string& test_name, float contents_scale) {
- scoped_refptr<PicturePileImpl> pile = FakePicturePileImpl::CreateFilledPile(
- gfx::Size(kTileSize, kTileSize), gfx::Size(kLayerSize, kLayerSize));
- // Content rect that will align with top-left tile at scale 1.0.
- gfx::Rect content_rect(0, 0, kTileSize, kTileSize);
-
- RasterSource::SolidColorAnalysis analysis;
- timer_.Reset();
- do {
- pile->PerformSolidColorAnalysis(content_rect, contents_scale, &analysis);
- timer_.NextLap();
- } while (!timer_.HasTimeLimitExpired());
-
- perf_test::PrintResult(
- "analyze", "", test_name, timer_.LapsPerSecond(), "runs/s", true);
- }
-
- void RunRasterTest(const std::string& test_name, float contents_scale) {
- scoped_refptr<PicturePileImpl> pile = FakePicturePileImpl::CreateFilledPile(
- gfx::Size(kTileSize, kTileSize), gfx::Size(kLayerSize, kLayerSize));
- // Content rect that will align with top-left tile at scale 1.0.
- gfx::Rect content_rect(0, 0, kTileSize, kTileSize);
-
- SkBitmap bitmap;
- bitmap.allocN32Pixels(1, 1);
- SkCanvas canvas(bitmap);
-
- timer_.Reset();
- do {
- pile->PlaybackToCanvas(&canvas, content_rect, contents_scale);
- timer_.NextLap();
- } while (!timer_.HasTimeLimitExpired());
-
- perf_test::PrintResult(
- "raster", "", test_name, timer_.LapsPerSecond(), "runs/s", true);
- }
-
- private:
- LapTimer timer_;
-};
-
-TEST_F(PicturePileImplPerfTest, Analyze) {
- RunAnalyzeTest("1", 1.0f);
- RunAnalyzeTest("4", 0.5f);
- RunAnalyzeTest("100", 0.1f);
-}
-
-TEST_F(PicturePileImplPerfTest, Raster) {
- RunRasterTest("1", 1.0f);
- RunRasterTest("4", 0.5f);
- RunRasterTest("100", 0.1f);
-}
-
-} // namespace
-} // namespace cc
« no previous file with comments | « cc/resources/picture_pile_impl.cc ('k') | cc/resources/picture_pile_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698