summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-07 21:40:49 +0000
committervollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-07 21:40:49 +0000
commitf2bbb4e8711e8504d016a204cf8ad26cf5486dc5 (patch)
tree09b7af7edae7bd66c1b2f7eb05775639a6e3179a
parentb685fcebf13a9e9859adfb69c980a0c3c162912e (diff)
downloadchromium_src-f2bbb4e8711e8504d016a204cf8ad26cf5486dc5.zip
chromium_src-f2bbb4e8711e8504d016a204cf8ad26cf5486dc5.tar.gz
chromium_src-f2bbb4e8711e8504d016a204cf8ad26cf5486dc5.tar.bz2
Add a stat to the smoothness benchmark for avg number of missing tiles.
BUG=None Review URL: https://chromiumcodereview.appspot.com/11478016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171845 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cc/append_quads_data.h7
-rw-r--r--cc/layer_tree_host_impl.cc5
-rw-r--r--cc/layer_tree_host_impl.h8
-rw-r--r--cc/picture_layer_impl.cc8
-rw-r--r--cc/rendering_stats.cc4
-rw-r--r--cc/rendering_stats.h1
-rw-r--r--cc/tiled_layer_impl.cc6
-rw-r--r--cc/tiled_layer_impl_unittest.cc4
-rw-r--r--tools/perf/perf_tools/smoothness_benchmark.py6
9 files changed, 33 insertions, 16 deletions
diff --git a/cc/append_quads_data.h b/cc/append_quads_data.h
index 46f5a33..43f9a72 100644
--- a/cc/append_quads_data.h
+++ b/cc/append_quads_data.h
@@ -5,6 +5,7 @@
#ifndef CC_APPEND_QUADS_DATA_H_
#define CC_APPEND_QUADS_DATA_H_
+#include "base/basictypes.h"
#include "cc/render_pass.h"
namespace cc {
@@ -12,14 +13,14 @@ namespace cc {
struct AppendQuadsData {
AppendQuadsData()
: hadOcclusionFromOutsideTargetSurface(false)
- , hadMissingTiles(false)
+ , numMissingTiles(0)
, renderPassId(0, 0)
{
}
explicit AppendQuadsData(RenderPass::Id renderPassId)
: hadOcclusionFromOutsideTargetSurface(false)
- , hadMissingTiles(false)
+ , numMissingTiles(0)
, renderPassId(renderPassId)
{
}
@@ -27,7 +28,7 @@ struct AppendQuadsData {
// Set by the QuadCuller.
bool hadOcclusionFromOutsideTargetSurface;
// Set by the layer appending quads.
- bool hadMissingTiles;
+ int64 numMissingTiles;
// Given to the layer appending quads.
const RenderPass::Id renderPassId;
};
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index c295e92..ec45331 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -222,6 +222,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(const LayerTreeSettings& settings, LayerTre
, m_numImplThreadScrolls(0)
, m_numMainThreadScrolls(0)
, m_cumulativeNumLayersDrawn(0)
+ , m_cumulativeNumMissingTiles(0)
{
DCHECK(m_proxy->isImplThread());
didVisibilityChange(this, m_visible);
@@ -557,7 +558,8 @@ bool LayerTreeHostImpl::calculateRenderPasses(FrameData& frame)
if (appendQuadsData.hadOcclusionFromOutsideTargetSurface)
targetRenderPass->has_occlusion_from_outside_target_surface = true;
- if (appendQuadsData.hadMissingTiles) {
+ if (appendQuadsData.numMissingTiles) {
+ m_cumulativeNumMissingTiles += appendQuadsData.numMissingTiles;
bool layerHasAnimatingTransform = it->screenSpaceTransformIsAnimating() || it->drawTransformIsAnimating();
if (layerHasAnimatingTransform)
drawFrame = false;
@@ -1573,6 +1575,7 @@ void LayerTreeHostImpl::renderingStats(RenderingStats* stats) const
stats->numImplThreadScrolls = m_numImplThreadScrolls;
stats->numMainThreadScrolls = m_numMainThreadScrolls;
stats->numLayersDrawn = m_cumulativeNumLayersDrawn;
+ stats->numMissingTiles = m_cumulativeNumMissingTiles;
if (m_tileManager)
m_tileManager->renderingStats(stats);
diff --git a/cc/layer_tree_host_impl.h b/cc/layer_tree_host_impl.h
index 07afc90..5328230 100644
--- a/cc/layer_tree_host_impl.h
+++ b/cc/layer_tree_host_impl.h
@@ -381,10 +381,12 @@ private:
scoped_ptr<FrameRateCounter> m_fpsCounter;
scoped_ptr<DebugRectHistory> m_debugRectHistory;
- size_t m_numImplThreadScrolls;
- size_t m_numMainThreadScrolls;
+ int64 m_numImplThreadScrolls;
+ int64 m_numMainThreadScrolls;
- size_t m_cumulativeNumLayersDrawn;
+ int64 m_cumulativeNumLayersDrawn;
+
+ int64 m_cumulativeNumMissingTiles;
AnimationControllerSet m_activeAnimationControllers;
diff --git a/cc/picture_layer_impl.cc b/cc/picture_layer_impl.cc
index 14b9404..61d8ebb 100644
--- a/cc/picture_layer_impl.cc
+++ b/cc/picture_layer_impl.cc
@@ -87,13 +87,13 @@ void PictureLayerImpl::appendQuads(QuadSink& quadSink,
scoped_ptr<CheckerboardDrawQuad> quad = CheckerboardDrawQuad::Create();
SkColor color = DebugColors::DefaultCheckerboardColor();
quad->SetNew(sharedQuadState, geometry_rect, color);
- appendQuadsData.hadMissingTiles |=
- quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
+ if (quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData))
+ appendQuadsData.numMissingTiles++;
} else {
scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
quad->SetNew(sharedQuadState, geometry_rect, backgroundColor());
- appendQuadsData.hadMissingTiles |=
- quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
+ if (quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData))
+ appendQuadsData.numMissingTiles++;
}
continue;
}
diff --git a/cc/rendering_stats.cc b/cc/rendering_stats.cc
index 56e0c12..530efbf 100644
--- a/cc/rendering_stats.cc
+++ b/cc/rendering_stats.cc
@@ -18,7 +18,8 @@ RenderingStats::RenderingStats()
totalPixelsRasterized(0),
numImplThreadScrolls(0),
numMainThreadScrolls(0),
- numLayersDrawn(0) {
+ numLayersDrawn(0),
+ numMissingTiles(0) {
}
void RenderingStats::EnumerateFields(Enumerator* enumerator) const {
@@ -35,6 +36,7 @@ void RenderingStats::EnumerateFields(Enumerator* enumerator) const {
enumerator->AddInt64("numImplThreadScrolls", numImplThreadScrolls);
enumerator->AddInt64("numMainThreadScrolls", numMainThreadScrolls);
enumerator->AddInt64("numLayersDrawn", numLayersDrawn);
+ enumerator->AddInt64("numMissingTiles", numMissingTiles);
}
} // namespace cc
diff --git a/cc/rendering_stats.h b/cc/rendering_stats.h
index 6111250..3eafa80 100644
--- a/cc/rendering_stats.h
+++ b/cc/rendering_stats.h
@@ -25,6 +25,7 @@ struct CC_EXPORT RenderingStats {
int64 numImplThreadScrolls;
int64 numMainThreadScrolls;
int64 numLayersDrawn;
+ int64 numMissingTiles;
// Note: when adding new members, please remember to update enumerateFields
// in rendering_stats.cc.
diff --git a/cc/tiled_layer_impl.cc b/cc/tiled_layer_impl.cc
index fbfb005..5b4e68c 100644
--- a/cc/tiled_layer_impl.cc
+++ b/cc/tiled_layer_impl.cc
@@ -160,11 +160,13 @@ void TiledLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuad
scoped_ptr<CheckerboardDrawQuad> checkerboardQuad = CheckerboardDrawQuad::Create();
checkerboardQuad->SetNew(sharedQuadState, tileRect, checkerColor);
- appendQuadsData.hadMissingTiles |= quadSink.append(checkerboardQuad.PassAs<DrawQuad>(), appendQuadsData);
+ if (quadSink.append(checkerboardQuad.PassAs<DrawQuad>(), appendQuadsData))
+ appendQuadsData.numMissingTiles++;
} else {
scoped_ptr<SolidColorDrawQuad> solidColorQuad = SolidColorDrawQuad::Create();
solidColorQuad->SetNew(sharedQuadState, tileRect, backgroundColor());
- appendQuadsData.hadMissingTiles |= quadSink.append(solidColorQuad.PassAs<DrawQuad>(), appendQuadsData);
+ if (quadSink.append(solidColorQuad.PassAs<DrawQuad>(), appendQuadsData))
+ appendQuadsData.numMissingTiles++;
}
continue;
}
diff --git a/cc/tiled_layer_impl_unittest.cc b/cc/tiled_layer_impl_unittest.cc
index e0f5433..7219605 100644
--- a/cc/tiled_layer_impl_unittest.cc
+++ b/cc/tiled_layer_impl_unittest.cc
@@ -137,7 +137,7 @@ TEST_F(TiledLayerImplTest, checkerboarding)
AppendQuadsData data;
layer->appendQuads(quadCuller, data);
EXPECT_EQ(quadCuller.quadList().size(), 4u);
- EXPECT_FALSE(data.hadMissingTiles);
+ EXPECT_EQ(0u, data.numMissingTiles);
for (size_t i = 0; i < quadCuller.quadList().size(); ++i)
EXPECT_EQ(quadCuller.quadList()[i]->material, DrawQuad::TILED_CONTENT);
@@ -152,7 +152,7 @@ TEST_F(TiledLayerImplTest, checkerboarding)
MockQuadCuller quadCuller;
AppendQuadsData data;
layer->appendQuads(quadCuller, data);
- EXPECT_TRUE(data.hadMissingTiles);
+ EXPECT_LT(0u, data.numMissingTiles);
EXPECT_EQ(quadCuller.quadList().size(), 4u);
for (size_t i = 0; i < quadCuller.quadList().size(); ++i)
EXPECT_NE(quadCuller.quadList()[i]->material, DrawQuad::TILED_CONTENT);
diff --git a/tools/perf/perf_tools/smoothness_benchmark.py b/tools/perf/perf_tools/smoothness_benchmark.py
index 31aaedd..96d393c 100644
--- a/tools/perf/perf_tools/smoothness_benchmark.py
+++ b/tools/perf/perf_tools/smoothness_benchmark.py
@@ -37,6 +37,10 @@ def CalcScrollResults(rendering_stats_deltas, results):
rendering_stats_deltas.get('numLayersDrawn', 0) /
float(num_frames_sent_to_screen))
+ num_missing_tiles = (
+ rendering_stats_deltas.get('numMissingTiles', 0) /
+ float(num_frames_sent_to_screen))
+
results.Add('mean_frame_time', 'ms', round(mean_frame_time_seconds * 1000, 3))
results.Add('dropped_percent', '%', round(dropped_percent * 100, 1),
data_type='unimportant')
@@ -45,6 +49,8 @@ def CalcScrollResults(rendering_stats_deltas, results):
data_type='unimportant')
results.Add('average_num_layers_drawn', '', round(num_layers, 1),
data_type='unimportant')
+ results.Add('average_num_missing_tiles', '', round(num_missing_tiles, 1),
+ data_type='unimportant')
def CalcPaintingResults(rendering_stats_deltas, results):
totalPaintTime = rendering_stats_deltas.get('totalPaintTimeInSeconds', 0)