diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 20:36:43 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 20:36:43 +0000 |
commit | 97c6a734bf17b2eafb1bac318236736edb7c3460 (patch) | |
tree | dd0b4b7f183e59efcc9b3db3d3cde58bfc9bfcd8 | |
parent | e13549ec4ece604cb4cb8b2cfaefc016015fef33 (diff) | |
download | chromium_src-97c6a734bf17b2eafb1bac318236736edb7c3460.zip chromium_src-97c6a734bf17b2eafb1bac318236736edb7c3460.tar.gz chromium_src-97c6a734bf17b2eafb1bac318236736edb7c3460.tar.bz2 |
cc: Remove OverdrawMetrics and --trace-overdraw flag.
These metrics are only recorded when --trace-overdraw is specified,
which means they are never recorded in practice because they are too
expensive to record. They get in the way of inverting the occlusion
relationship with AppendQuads, so remove them.
R=enne@chromium.org, piman@chromium.org, enne
BUG=344962,351493
Review URL: https://codereview.chromium.org/195803003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256630 0039d316-1c4b-4281-b951-d872f2087c98
26 files changed, 44 insertions, 844 deletions
diff --git a/cc/base/switches.cc b/cc/base/switches.cc index 46f4992..4cff4d2 100644 --- a/cc/base/switches.cc +++ b/cc/base/switches.cc @@ -27,10 +27,6 @@ const char kTopControlsHideThreshold[] = "top-controls-hide-threshold"; // Percentage of the top controls need to be shown before they will auto show. const char kTopControlsShowThreshold[] = "top-controls-show-threshold"; -// Show metrics about overdraw in about:tracing recordings, such as the number -// of pixels culled, and the number of pixels drawn, for each frame. -const char kTraceOverdraw[] = "trace-overdraw"; - // Re-rasters everything multiple times to simulate a much slower machine. // Give a scale factor to cause raster to take that many times longer to // complete, such as --slow-down-raster-scale-factor=25. diff --git a/cc/base/switches.h b/cc/base/switches.h index 92339cb..8cb043f 100644 --- a/cc/base/switches.h +++ b/cc/base/switches.h @@ -22,7 +22,6 @@ CC_EXPORT extern const char kEnableTopControlsPositionCalculation[]; CC_EXPORT extern const char kJankInsteadOfCheckerboard[]; CC_EXPORT extern const char kTopControlsHeight[]; CC_EXPORT extern const char kTopControlsHideThreshold[]; -CC_EXPORT extern const char kTraceOverdraw[]; CC_EXPORT extern const char kTopControlsShowThreshold[]; CC_EXPORT extern const char kSlowDownRasterScaleFactor[]; CC_EXPORT extern const char kCompositeToMailbox[]; @@ -106,8 +106,6 @@ 'debug/micro_benchmark_controller.h', 'debug/micro_benchmark_controller_impl.cc', 'debug/micro_benchmark_controller_impl.h', - 'debug/overdraw_metrics.cc', - 'debug/overdraw_metrics.h', 'debug/paint_time_counter.cc', 'debug/paint_time_counter.h', 'debug/picture_record_benchmark.cc', diff --git a/cc/debug/overdraw_metrics.cc b/cc/debug/overdraw_metrics.cc deleted file mode 100644 index 02f0745..0000000 --- a/cc/debug/overdraw_metrics.cc +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright 2012 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/debug/overdraw_metrics.h" - -#include "base/debug/trace_event.h" -#include "base/metrics/histogram.h" -#include "cc/base/math_util.h" -#include "cc/trees/layer_tree_host.h" -#include "cc/trees/layer_tree_host_impl.h" -#include "ui/gfx/quad_f.h" -#include "ui/gfx/rect.h" -#include "ui/gfx/transform.h" - -namespace cc { - -OverdrawMetrics::OverdrawMetrics(bool record_metrics_for_frame) - : record_metrics_for_frame_(record_metrics_for_frame), - pixels_painted_(0), - pixels_uploaded_opaque_(0), - pixels_uploaded_translucent_(0), - tiles_culled_for_upload_(0), - contents_texture_use_bytes_(0), - render_surface_texture_use_bytes_(0), - pixels_drawn_opaque_(0), - pixels_drawn_translucent_(0), - pixels_culled_for_drawing_(0) {} - -static inline float WedgeProduct(const gfx::PointF& p1, const gfx::PointF& p2) { - return p1.x() * p2.y() - p1.y() * p2.x(); -} - -// Calculates area of an arbitrary convex polygon with up to 8 points. -static inline float PolygonArea(const gfx::PointF (&points)[8], - int num_points) { - if (num_points < 3) - return 0; - - float area = 0; - for (int i = 0; i < num_points; ++i) - area += WedgeProduct(points[i], points[(i+1)%num_points]); - return std::abs(0.5f * area); -} - -// Takes a given quad, maps it by the given transformation, and gives the area -// of the resulting polygon. -static inline float AreaOfMappedQuad(const gfx::Transform& transform, - const gfx::QuadF& quad) { - gfx::PointF clipped_quad[8]; - int num_vertices_in_clipped_quad = 0; - MathUtil::MapClippedQuad(transform, - quad, - clipped_quad, - &num_vertices_in_clipped_quad); - return PolygonArea(clipped_quad, num_vertices_in_clipped_quad); -} - -void OverdrawMetrics::DidPaint(const gfx::Rect& painted_rect) { - if (!record_metrics_for_frame_) - return; - - pixels_painted_ += - static_cast<float>(painted_rect.width()) * painted_rect.height(); -} - -void OverdrawMetrics::DidCullTilesForUpload(int count) { - if (record_metrics_for_frame_) - tiles_culled_for_upload_ += count; -} - -void OverdrawMetrics::DidUpload(const gfx::Transform& transform_to_target, - const gfx::Rect& upload_rect, - const gfx::Rect& opaque_rect) { - if (!record_metrics_for_frame_) - return; - - float upload_area = - AreaOfMappedQuad(transform_to_target, gfx::QuadF(upload_rect)); - float upload_opaque_area = - AreaOfMappedQuad(transform_to_target, - gfx::QuadF(gfx::IntersectRects(opaque_rect, - upload_rect))); - - pixels_uploaded_opaque_ += upload_opaque_area; - pixels_uploaded_translucent_ += upload_area - upload_opaque_area; -} - -void OverdrawMetrics::DidUseContentsTextureMemoryBytes( - size_t contents_texture_use_bytes) { - if (!record_metrics_for_frame_) - return; - - contents_texture_use_bytes_ += contents_texture_use_bytes; -} - -void OverdrawMetrics::DidUseRenderSurfaceTextureMemoryBytes( - size_t render_surface_use_bytes) { - if (!record_metrics_for_frame_) - return; - - render_surface_texture_use_bytes_ += render_surface_use_bytes; -} - -void OverdrawMetrics::DidCullForDrawing( - const gfx::Transform& transform_to_target, - const gfx::Rect& before_cull_rect, - const gfx::Rect& after_cull_rect) { - if (!record_metrics_for_frame_) - return; - - float before_cull_area = - AreaOfMappedQuad(transform_to_target, gfx::QuadF(before_cull_rect)); - float after_cull_area = - AreaOfMappedQuad(transform_to_target, gfx::QuadF(after_cull_rect)); - - pixels_culled_for_drawing_ += before_cull_area - after_cull_area; -} - -void OverdrawMetrics::DidDraw(const gfx::Transform& transform_to_target, - const gfx::Rect& after_cull_rect, - const gfx::Rect& opaque_rect) { - if (!record_metrics_for_frame_) - return; - - float after_cull_area = - AreaOfMappedQuad(transform_to_target, gfx::QuadF(after_cull_rect)); - float after_cull_opaque_area = - AreaOfMappedQuad(transform_to_target, - gfx::QuadF(gfx::IntersectRects(opaque_rect, - after_cull_rect))); - - pixels_drawn_opaque_ += after_cull_opaque_area; - pixels_drawn_translucent_ += after_cull_area - after_cull_opaque_area; -} - -void OverdrawMetrics::RecordMetrics( - const LayerTreeHost* layer_tree_host) const { - if (record_metrics_for_frame_) - RecordMetricsInternal<LayerTreeHost>(UpdateAndCommit, layer_tree_host); -} - -void OverdrawMetrics::RecordMetrics( - const LayerTreeHostImpl* layer_tree_host_impl) const { - if (record_metrics_for_frame_) { - RecordMetricsInternal<LayerTreeHostImpl>(DrawingToScreen, - layer_tree_host_impl); - } -} - -static gfx::Size DrawViewportSize(const LayerTreeHost* host) { - return host->device_viewport_size(); -} -static gfx::Size DrawViewportSize(const LayerTreeHostImpl* host_impl) { - return host_impl->DrawViewportSize(); -} - -template <typename LayerTreeHostType> -void OverdrawMetrics::RecordMetricsInternal( - MetricsType metrics_type, - const LayerTreeHostType* layer_tree_host) const { - // This gives approximately 10x the percentage of pixels to fill the viewport - // once. - float normalization = 1000.f / (DrawViewportSize(layer_tree_host).width() * - DrawViewportSize(layer_tree_host).height()); - // This gives approximately 100x the percentage of tiles to fill the viewport - // once, if all tiles were 256x256. - float tile_normalization = - 10000.f / (DrawViewportSize(layer_tree_host).width() / 256.f * - DrawViewportSize(layer_tree_host).height() / 256.f); - // This gives approximately 10x the percentage of bytes to fill the viewport - // once, assuming 4 bytes per pixel. - float byte_normalization = normalization / 4; - - switch (metrics_type) { - case DrawingToScreen: { - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Renderer4.pixelCountOpaque_Draw", - static_cast<int>(normalization * pixels_drawn_opaque_), - 100, 1000000, 50); - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Renderer4.pixelCountTranslucent_Draw", - static_cast<int>(normalization * pixels_drawn_translucent_), - 100, 1000000, 50); - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Renderer4.pixelCountCulled_Draw", - static_cast<int>(normalization * pixels_culled_for_drawing_), - 100, 1000000, 50); - - TRACE_COUNTER_ID1("cc", - "DrawPixelsCulled", - layer_tree_host, - pixels_culled_for_drawing_); - TRACE_EVENT2("cc", - "OverdrawMetrics", - "PixelsDrawnOpaque", - pixels_drawn_opaque_, - "PixelsDrawnTranslucent", - pixels_drawn_translucent_); - break; - } - case UpdateAndCommit: { - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Renderer4.pixelCountPainted", - static_cast<int>(normalization * pixels_painted_), - 100, 1000000, 50); - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Renderer4.pixelCountOpaque_Upload", - static_cast<int>(normalization * pixels_uploaded_opaque_), - 100, 1000000, 50); - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Renderer4.pixelCountTranslucent_Upload", - static_cast<int>(normalization * pixels_uploaded_translucent_), - 100, 1000000, 50); - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Renderer4.tileCountCulled_Upload", - static_cast<int>(tile_normalization * tiles_culled_for_upload_), - 100, 10000000, 50); - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Renderer4.renderSurfaceTextureBytes_ViewportScaled", - static_cast<int>( - byte_normalization * render_surface_texture_use_bytes_), - 10, 1000000, 50); - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Renderer4.renderSurfaceTextureBytes_Unscaled", - static_cast<int>(render_surface_texture_use_bytes_ / 1000), - 1000, 100000000, 50); - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Renderer4.contentsTextureBytes_ViewportScaled", - static_cast<int>(byte_normalization * contents_texture_use_bytes_), - 10, 1000000, 50); - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Renderer4.contentsTextureBytes_Unscaled", - static_cast<int>(contents_texture_use_bytes_ / 1000), - 1000, 100000000, 50); - { - TRACE_COUNTER_ID1("cc", - "UploadTilesCulled", - layer_tree_host, - tiles_culled_for_upload_); - TRACE_EVENT2("cc", - "OverdrawMetrics", - "PixelsUploadedOpaque", - pixels_uploaded_opaque_, - "PixelsUploadedTranslucent", - pixels_uploaded_translucent_); - } - { - // This must be in a different scope than the TRACE_EVENT2 above. - TRACE_EVENT1("cc", - "OverdrawPaintMetrics", - "PixelsPainted", - pixels_painted_); - } - { - // This must be in a different scope than the TRACE_EVENTs above. - TRACE_EVENT2("cc", - "OverdrawPaintMetrics", - "ContentsTextureBytes", - contents_texture_use_bytes_, - "RenderSurfaceTextureBytes", - render_surface_texture_use_bytes_); - } - break; - } - } -} - -} // namespace cc diff --git a/cc/debug/overdraw_metrics.h b/cc/debug/overdraw_metrics.h deleted file mode 100644 index c53b2aa..0000000 --- a/cc/debug/overdraw_metrics.h +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2012 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. - -#ifndef CC_DEBUG_OVERDRAW_METRICS_H_ -#define CC_DEBUG_OVERDRAW_METRICS_H_ - -#include "base/basictypes.h" -#include "base/memory/scoped_ptr.h" - -namespace gfx { -class Rect; -class Transform; -} - -namespace cc { -class LayerTreeHost; -class LayerTreeHostImpl; - -class OverdrawMetrics { - public: - static scoped_ptr<OverdrawMetrics> Create(bool record_metrics_for_frame) { - return make_scoped_ptr(new OverdrawMetrics(record_metrics_for_frame)); - } - - // These methods are used for saving metrics during update/commit. - - // Record pixels painted by WebKit into the texture updater, but does not mean - // the pixels were rasterized in main memory. - void DidPaint(const gfx::Rect& painted_rect); - // Records that an invalid tile was culled and did not need to be - // painted/uploaded, and did not contribute to other tiles needing to be - // painted. - void DidCullTilesForUpload(int count); - // Records pixels that were uploaded to texture memory. - void DidUpload(const gfx::Transform& transform_to_target, - const gfx::Rect& upload_rect, - const gfx::Rect& opaque_rect); - // Record contents texture(s) behind present using the given number of bytes. - void DidUseContentsTextureMemoryBytes(size_t contents_texture_use_bytes); - // Record RenderSurfaceImpl texture(s) being present using the given number of - // bytes. - void DidUseRenderSurfaceTextureMemoryBytes(size_t render_surface_use_bytes); - - // These methods are used for saving metrics during draw. - - // Record pixels that were not drawn to screen. - void DidCullForDrawing(const gfx::Transform& transform_to_target, - const gfx::Rect& before_cull_rect, - const gfx::Rect& after_cull_rect); - // Record pixels that were drawn to screen. - void DidDraw(const gfx::Transform& transform_to_target, - const gfx::Rect& after_cull_rect, - const gfx::Rect& opaque_rect); - - void RecordMetrics(const LayerTreeHost* layer_tree_host) const; - void RecordMetrics(const LayerTreeHostImpl* layer_tree_host_impl) const; - - // Accessors for tests. - float pixels_drawn_opaque() const { return pixels_drawn_opaque_; } - float pixels_drawn_translucent() const { return pixels_drawn_translucent_; } - float pixels_culled_for_drawing() const { return pixels_culled_for_drawing_; } - float pixels_painted() const { return pixels_painted_; } - float pixels_uploaded_opaque() const { return pixels_uploaded_opaque_; } - float pixels_uploaded_translucent() const { - return pixels_uploaded_translucent_; - } - int tiles_culled_for_upload() const { return tiles_culled_for_upload_; } - - private: - enum MetricsType { - UpdateAndCommit, - DrawingToScreen - }; - - explicit OverdrawMetrics(bool record_metrics_for_frame); - - template <typename LayerTreeHostType> - void RecordMetricsInternal(MetricsType metrics_type, - const LayerTreeHostType* layer_tree_host) const; - - // When false this class is a giant no-op. - bool record_metrics_for_frame_; - - // These values are used for saving metrics during update/commit. - - // Count of pixels that were painted due to invalidation. - float pixels_painted_; - // Count of pixels uploaded to textures and known to be opaque. - float pixels_uploaded_opaque_; - // Count of pixels uploaded to textures and not known to be opaque. - float pixels_uploaded_translucent_; - // Count of tiles that were invalidated but not uploaded. - int tiles_culled_for_upload_; - // Count the number of bytes in contents textures. - uint64 contents_texture_use_bytes_; - // Count the number of bytes in RenderSurfaceImpl textures. - uint64 render_surface_texture_use_bytes_; - - // These values are used for saving metrics during draw. - - // Count of pixels that are opaque (and thus occlude). Ideally this is no more - // than wiewport width x height. - float pixels_drawn_opaque_; - // Count of pixels that are possibly translucent, and cannot occlude. - float pixels_drawn_translucent_; - // Count of pixels not drawn as they are occluded by somthing opaque. - float pixels_culled_for_drawing_; - - DISALLOW_COPY_AND_ASSIGN(OverdrawMetrics); -}; - -} // namespace cc - -#endif // CC_DEBUG_OVERDRAW_METRICS_H_ diff --git a/cc/layers/nine_patch_layer_unittest.cc b/cc/layers/nine_patch_layer_unittest.cc index 94e75eb..1f93b4c 100644 --- a/cc/layers/nine_patch_layer_unittest.cc +++ b/cc/layers/nine_patch_layer_unittest.cc @@ -4,7 +4,6 @@ #include "cc/layers/nine_patch_layer.h" -#include "cc/debug/overdraw_metrics.h" #include "cc/resources/prioritized_resource_manager.h" #include "cc/resources/resource_provider.h" #include "cc/resources/resource_update_queue.h" @@ -57,7 +56,8 @@ TEST_F(NinePatchLayerTest, SetLayerProperties) { EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get()); ResourceUpdateQueue queue; - OcclusionTracker<Layer> occlusion_tracker(gfx::Rect(), false); + gfx::Rect screen_space_clip_rect; + OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect); test_layer->SavePaintProperties(); test_layer->Update(&queue, &occlusion_tracker); diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc index dc434157..6f2f940 100644 --- a/cc/layers/picture_layer_unittest.cc +++ b/cc/layers/picture_layer_unittest.cc @@ -35,7 +35,7 @@ TEST(PictureLayerTest, NoTilesIfEmptyBounds) { layer->SetIsDrawable(true); layer->SavePaintProperties(); - OcclusionTracker<Layer> occlusion(gfx::Rect(0, 0, 1000, 1000), false); + OcclusionTracker<Layer> occlusion(gfx::Rect(0, 0, 1000, 1000)); scoped_ptr<ResourceUpdateQueue> queue(new ResourceUpdateQueue); layer->Update(queue.get(), &occlusion); diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc index 2b2b010..ccba3ae 100644 --- a/cc/layers/scrollbar_layer_unittest.cc +++ b/cc/layers/scrollbar_layer_unittest.cc @@ -652,7 +652,8 @@ class ScrollbarLayerTestResourceCreation : public testing::Test { EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get()); ResourceUpdateQueue queue; - OcclusionTracker<Layer> occlusion_tracker(gfx::Rect(), false); + gfx::Rect screen_space_clip_rect; + OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect); scrollbar_layer->SavePaintProperties(); for (int update_counter = 0; update_counter < num_updates; update_counter++) @@ -738,7 +739,8 @@ class ScaledScrollbarLayerTestResourceCreation : public testing::Test { EXPECT_EQ(scrollbar_layer->layer_tree_host(), layer_tree_host_.get()); ResourceUpdateQueue queue; - OcclusionTracker<Layer> occlusion_tracker(gfx::Rect(), false); + gfx::Rect screen_space_clip_rect; + OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect); scrollbar_layer->SavePaintProperties(); scrollbar_layer->Update(&queue, &occlusion_tracker); @@ -814,7 +816,8 @@ class ScaledScrollbarLayerTestScaledRasterization : public testing::Test { scaled_size.height()); ResourceUpdateQueue queue; - OcclusionTracker<Layer> occlusion_tracker(gfx::Rect(), false); + gfx::Rect screen_space_clip_rect; + OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect); scrollbar_layer->SavePaintProperties(); scrollbar_layer->Update(&queue, &occlusion_tracker); diff --git a/cc/layers/tiled_layer.cc b/cc/layers/tiled_layer.cc index 26a3e5c..5607496 100644 --- a/cc/layers/tiled_layer.cc +++ b/cc/layers/tiled_layer.cc @@ -10,7 +10,6 @@ #include "base/auto_reset.h" #include "base/basictypes.h" #include "build/build_config.h" -#include "cc/debug/overdraw_metrics.h" #include "cc/layers/layer_impl.h" #include "cc/layers/tiled_layer_impl.h" #include "cc/resources/layer_updater.h" @@ -342,9 +341,6 @@ bool TiledLayer::UpdateTiles(int left, MarkTilesForUpdate( &update_rect, &paint_rect, left, top, right, bottom, ignore_occlusions); - if (occlusion) - occlusion->overdraw_metrics()->DidPaint(paint_rect); - if (paint_rect.IsEmpty()) return true; @@ -360,12 +356,6 @@ void TiledLayer::MarkOcclusionsAndRequestTextures( int right, int bottom, const OcclusionTracker<Layer>* occlusion) { - // There is some difficult dependancies between occlusions, recording - // occlusion metrics and requesting memory so those are encapsulated in this - // function: - We only want to call RequestLate on unoccluded textures (to - // preserve memory for other layers when near OOM). - We only want to record - // occlusion metrics if all memory requests succeed. - int occluded_tile_count = 0; bool succeeded = true; for (int j = top; j <= bottom; ++j) { @@ -390,11 +380,6 @@ void TiledLayer::MarkOcclusionsAndRequestTextures( } } } - - if (!succeeded) - return; - if (occlusion) - occlusion->overdraw_metrics()->DidCullTilesForUpload(occluded_tile_count); } bool TiledLayer::HaveTexturesForTiles(int left, @@ -566,10 +551,6 @@ void TiledLayer::UpdateTileTextures(const gfx::Rect& update_rect, tile->updater_resource()->Update( queue, source_rect, dest_offset, tile->partial_update); - if (occlusion) { - occlusion->overdraw_metrics()-> - DidUpload(gfx::Transform(), source_rect, tile->opaque_rect()); - } } } } diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc index f784a52..0e5d4a28 100644 --- a/cc/layers/tiled_layer_unittest.cc +++ b/cc/layers/tiled_layer_unittest.cc @@ -8,7 +8,6 @@ #include <vector> #include "base/run_loop.h" -#include "cc/debug/overdraw_metrics.h" #include "cc/resources/bitmap_content_layer_updater.h" #include "cc/resources/layer_painter.h" #include "cc/resources/prioritized_resource_manager.h" @@ -33,7 +32,7 @@ namespace { class TestOcclusionTracker : public OcclusionTracker<Layer> { public: - TestOcclusionTracker() : OcclusionTracker(gfx::Rect(0, 0, 1000, 1000), true) { + TestOcclusionTracker() : OcclusionTracker(gfx::Rect(0, 0, 1000, 1000)) { stack_.push_back(StackObject()); } @@ -301,11 +300,6 @@ TEST_F(TiledLayerTest, PushOccludedDirtyTiles) { CalcDrawProps(&render_surface_layer_list); UpdateAndPush(layer, layer_impl); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR( - occluded.overdraw_metrics()->pixels_uploaded_translucent(), 20000, 1); - EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); - // We should have both tiles on the impl side. EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0)); EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 1)); @@ -321,12 +315,6 @@ TEST_F(TiledLayerTest, PushOccludedDirtyTiles) { CalcDrawProps(&render_surface_layer_list); UpdateAndPush(layer, layer_impl); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - 20000 + 2500, - 1); - EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); - // We should still have both tiles, as part of the top tile is still // unoccluded. EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0)); @@ -573,10 +561,7 @@ TEST_F(TiledLayerTest, PushIdlePaintedOccludedTiles) { layer->draw_properties().visible_content_rect = gfx::Rect(0, 0, 100, 100); UpdateAndPush(layer, layer_impl); - // We should have the prepainted tile on the impl side, but culled it during - // paint. EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0)); - EXPECT_EQ(1, occluded.overdraw_metrics()->tiles_culled_for_upload()); } TEST_F(TiledLayerTest, PushTilesMarkedDirtyDuringPaint) { @@ -1228,11 +1213,6 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusion) { layer->Update(queue_.get(), &occluded); EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count()); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR( - occluded.overdraw_metrics()->pixels_uploaded_translucent(), 330000, 1); - EXPECT_EQ(3, occluded.overdraw_metrics()->tiles_culled_for_upload()); - layer->fake_layer_updater()->ClearUpdateCount(); layer->SetTexturePriorities(priority_calculator_); resource_manager_->PrioritizeTextures(); @@ -1243,12 +1223,6 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusion) { layer->Update(queue_.get(), &occluded); EXPECT_EQ(36 - 2, layer->fake_layer_updater()->update_count()); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - 330000 + 340000, - 1); - EXPECT_EQ(3 + 2, occluded.overdraw_metrics()->tiles_culled_for_upload()); - layer->fake_layer_updater()->ClearUpdateCount(); layer->SetTexturePriorities(priority_calculator_); resource_manager_->PrioritizeTextures(); @@ -1258,12 +1232,6 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusion) { layer->SavePaintProperties(); layer->Update(queue_.get(), &occluded); EXPECT_EQ(36, layer->fake_layer_updater()->update_count()); - - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - 330000 + 340000 + 360000, - 1); - EXPECT_EQ(3 + 2, occluded.overdraw_metrics()->tiles_culled_for_upload()); } TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndVisiblityConstraints) { @@ -1294,11 +1262,6 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndVisiblityConstraints) { layer->Update(queue_.get(), &occluded); EXPECT_EQ(24 - 3, layer->fake_layer_updater()->update_count()); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR( - occluded.overdraw_metrics()->pixels_uploaded_translucent(), 210000, 1); - EXPECT_EQ(3, occluded.overdraw_metrics()->tiles_culled_for_upload()); - layer->fake_layer_updater()->ClearUpdateCount(); // Now the visible region stops at the edge of the occlusion so the partly @@ -1313,12 +1276,6 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndVisiblityConstraints) { layer->Update(queue_.get(), &occluded); EXPECT_EQ(24 - 6, layer->fake_layer_updater()->update_count()); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - 210000 + 180000, - 1); - EXPECT_EQ(3 + 6, occluded.overdraw_metrics()->tiles_culled_for_upload()); - layer->fake_layer_updater()->ClearUpdateCount(); // Now the visible region is even smaller than the occlusion, it should have @@ -1332,12 +1289,6 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndVisiblityConstraints) { layer->SavePaintProperties(); layer->Update(queue_.get(), &occluded); EXPECT_EQ(24 - 6, layer->fake_layer_updater()->update_count()); - - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - 210000 + 180000 + 180000, - 1); - EXPECT_EQ(3 + 6 + 6, occluded.overdraw_metrics()->tiles_culled_for_upload()); } TEST_F(TiledLayerTest, TilesNotPaintedWithoutInvalidation) { @@ -1364,12 +1315,7 @@ TEST_F(TiledLayerTest, TilesNotPaintedWithoutInvalidation) { layer->SavePaintProperties(); layer->Update(queue_.get(), &occluded); EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count()); - { UpdateTextures(); } - - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR( - occluded.overdraw_metrics()->pixels_uploaded_translucent(), 330000, 1); - EXPECT_EQ(3, occluded.overdraw_metrics()->tiles_culled_for_upload()); + UpdateTextures(); layer->fake_layer_updater()->ClearUpdateCount(); layer->SetTexturePriorities(priority_calculator_); @@ -1380,11 +1326,6 @@ TEST_F(TiledLayerTest, TilesNotPaintedWithoutInvalidation) { // now. layer->Update(queue_.get(), &occluded); EXPECT_EQ(3, layer->fake_layer_updater()->update_count()); - - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR( - occluded.overdraw_metrics()->pixels_uploaded_translucent(), 330000, 1); - EXPECT_EQ(6, occluded.overdraw_metrics()->tiles_culled_for_upload()); } TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndTransforms) { @@ -1419,11 +1360,6 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndTransforms) { layer->SavePaintProperties(); layer->Update(queue_.get(), &occluded); EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count()); - - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR( - occluded.overdraw_metrics()->pixels_uploaded_translucent(), 330000, 1); - EXPECT_EQ(3, occluded.overdraw_metrics()->tiles_culled_for_upload()); } TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndScaling) { @@ -1469,12 +1405,6 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndScaling) { int visible_tiles1 = 6 * 6; EXPECT_EQ(visible_tiles1, layer->fake_layer_updater()->update_count()); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - visible_tiles1 * 100 * 100, - 1); - EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); - layer->fake_layer_updater()->ClearUpdateCount(); // The occlusion of 300x100 will be cover 3 tiles as tiles are 100x100 still. @@ -1491,13 +1421,6 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndScaling) { int visible_tiles2 = 6 * 6 - 3; EXPECT_EQ(visible_tiles2, layer->fake_layer_updater()->update_count()); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - visible_tiles2 * 100 * 100 + - visible_tiles1 * 100 * 100, - 1); - EXPECT_EQ(3, occluded.overdraw_metrics()->tiles_culled_for_upload()); - layer->fake_layer_updater()->ClearUpdateCount(); // This makes sure content scaling and transforms work together. @@ -1523,14 +1446,6 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndScaling) { layer->Update(queue_.get(), &occluded); int visible_tiles3 = 6 * 6 - 6; EXPECT_EQ(visible_tiles3, layer->fake_layer_updater()->update_count()); - - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - visible_tiles3 * 100 * 100 + - visible_tiles2 * 100 * 100 + - visible_tiles1 * 100 * 100, - 1); - EXPECT_EQ(6 + 3, occluded.overdraw_metrics()->tiles_culled_for_upload()); } TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) { @@ -1568,12 +1483,6 @@ TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) { opaque_contents = layer->VisibleContentOpaqueRegion(); EXPECT_TRUE(opaque_contents.IsEmpty()); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_painted(), 20000, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR( - occluded.overdraw_metrics()->pixels_uploaded_translucent(), 20000, 1); - EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); - // VisibleContentOpaqueRegion should match the visible part of what is painted // opaque. opaque_paint_rect = gfx::Rect(10, 10, 90, 190); @@ -1588,13 +1497,6 @@ TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) { EXPECT_EQ(gfx::IntersectRects(opaque_paint_rect, visible_bounds).ToString(), opaque_contents.ToString()); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_painted(), 20000 * 2, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 17100, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - 20000 + 20000 - 17100, - 1); - EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); - // If we paint again without invalidating, the same stuff should be opaque. layer->fake_layer_updater()->SetOpaquePaintRect(gfx::Rect()); layer->SetTexturePriorities(priority_calculator_); @@ -1606,13 +1508,6 @@ TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) { EXPECT_EQ(gfx::IntersectRects(opaque_paint_rect, visible_bounds).ToString(), opaque_contents.ToString()); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_painted(), 20000 * 2, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 17100, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - 20000 + 20000 - 17100, - 1); - EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); - // If we repaint a non-opaque part of the tile, then it shouldn't lose its // opaque-ness. And other tiles should not be affected. layer->fake_layer_updater()->SetOpaquePaintRect(gfx::Rect()); @@ -1626,13 +1521,6 @@ TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) { EXPECT_EQ(gfx::IntersectRects(opaque_paint_rect, visible_bounds).ToString(), opaque_contents.ToString()); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_painted(), 20000 * 2 + 1, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 17100, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - 20000 + 20000 - 17100 + 1, - 1); - EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); - // If we repaint an opaque part of the tile, then it should lose its // opaque-ness. But other tiles should still not be affected. layer->fake_layer_updater()->SetOpaquePaintRect(gfx::Rect()); @@ -1646,77 +1534,6 @@ TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) { EXPECT_EQ(gfx::IntersectRects(gfx::Rect(10, 100, 90, 100), visible_bounds).ToString(), opaque_contents.ToString()); - - EXPECT_NEAR( - occluded.overdraw_metrics()->pixels_painted(), 20000 * 2 + 1 + 1, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 17100, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - 20000 + 20000 - 17100 + 1 + 1, - 1); - EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); -} - -TEST_F(TiledLayerTest, PixelsPaintedMetrics) { - scoped_refptr<FakeTiledLayer> layer = - make_scoped_refptr(new FakeTiledLayer(resource_manager_.get())); - RenderSurfaceLayerList render_surface_layer_list; - TestOcclusionTracker occluded; - occlusion_ = &occluded; - layer_tree_host_->SetViewportSize(gfx::Size(1000, 1000)); - - layer_tree_host_->root_layer()->AddChild(layer); - - // The tile size is 100x100, so this invalidates and then paints two tiles in - // various ways. - - gfx::Rect opaque_paint_rect; - Region opaque_contents; - - gfx::Rect content_bounds = gfx::Rect(0, 0, 100, 300); - layer->SetBounds(content_bounds.size()); - CalcDrawProps(&render_surface_layer_list); - - // Invalidates and paints the whole layer. - layer->fake_layer_updater()->SetOpaquePaintRect(gfx::Rect()); - layer->InvalidateContentRect(content_bounds); - layer->SetTexturePriorities(priority_calculator_); - resource_manager_->PrioritizeTextures(); - layer->SavePaintProperties(); - layer->Update(queue_.get(), &occluded); - UpdateTextures(); - opaque_contents = layer->VisibleContentOpaqueRegion(); - EXPECT_TRUE(opaque_contents.IsEmpty()); - - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_painted(), 30000, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR( - occluded.overdraw_metrics()->pixels_uploaded_translucent(), 30000, 1); - EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); - - // Invalidates an area on the top and bottom tile, which will cause us to - // paint the tile in the middle, even though it is not dirty and will not be - // uploaded. - layer->fake_layer_updater()->SetOpaquePaintRect(gfx::Rect()); - layer->InvalidateContentRect(gfx::Rect(0, 0, 1, 1)); - layer->InvalidateContentRect(gfx::Rect(50, 200, 10, 10)); - layer->SetTexturePriorities(priority_calculator_); - resource_manager_->PrioritizeTextures(); - layer->SavePaintProperties(); - layer->Update(queue_.get(), &occluded); - UpdateTextures(); - opaque_contents = layer->VisibleContentOpaqueRegion(); - EXPECT_TRUE(opaque_contents.IsEmpty()); - - // The middle tile was painted even though not invalidated. - EXPECT_NEAR( - occluded.overdraw_metrics()->pixels_painted(), 30000 + 60 * 210, 1); - // The pixels uploaded will not include the non-invalidated tile in the - // middle. - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1); - EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_translucent(), - 30000 + 1 + 100, - 1); - EXPECT_EQ(0, occluded.overdraw_metrics()->tiles_culled_for_upload()); } TEST_F(TiledLayerTest, DontAllocateContentsWhenTargetSurfaceCantBeAllocated) { diff --git a/cc/layers/ui_resource_layer_unittest.cc b/cc/layers/ui_resource_layer_unittest.cc index c05d312..1e0e1dea 100644 --- a/cc/layers/ui_resource_layer_unittest.cc +++ b/cc/layers/ui_resource_layer_unittest.cc @@ -4,7 +4,6 @@ #include "cc/layers/ui_resource_layer.h" -#include "cc/debug/overdraw_metrics.h" #include "cc/resources/prioritized_resource_manager.h" #include "cc/resources/resource_provider.h" #include "cc/resources/resource_update_queue.h" @@ -58,7 +57,8 @@ TEST_F(UIResourceLayerTest, SetBitmap) { EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get()); ResourceUpdateQueue queue; - OcclusionTracker<Layer> occlusion_tracker(gfx::Rect(), false); + gfx::Rect screen_space_clip_rect; + OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect); test_layer->SavePaintProperties(); test_layer->Update(&queue, &occlusion_tracker); @@ -86,7 +86,8 @@ TEST_F(UIResourceLayerTest, SetUIResourceId) { EXPECT_EQ(test_layer->layer_tree_host(), layer_tree_host_.get()); ResourceUpdateQueue queue; - OcclusionTracker<Layer> occlusion_tracker(gfx::Rect(), false); + gfx::Rect screen_space_clip_rect; + OcclusionTracker<Layer> occlusion_tracker(screen_space_clip_rect); test_layer->SavePaintProperties(); test_layer->Update(&queue, &occlusion_tracker); diff --git a/cc/test/test_occlusion_tracker.h b/cc/test/test_occlusion_tracker.h index 6eec732..d62f8f6 100644 --- a/cc/test/test_occlusion_tracker.h +++ b/cc/test/test_occlusion_tracker.h @@ -15,10 +15,8 @@ namespace cc { template <typename LayerType> class TestOcclusionTracker : public OcclusionTracker<LayerType> { public: - TestOcclusionTracker(const gfx::Rect& screen_scissor_rect, - bool record_metrics_for_frame) - : OcclusionTracker<LayerType>(screen_scissor_rect, - record_metrics_for_frame) {} + explicit TestOcclusionTracker(const gfx::Rect& screen_scissor_rect) + : OcclusionTracker<LayerType>(screen_scissor_rect) {} Region occlusion_from_inside_target() const { return OcclusionTracker<LayerType>::stack_.back() diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 40ed7ac..f4bfada 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -20,7 +20,6 @@ #include "cc/animation/layer_animation_controller.h" #include "cc/base/math_util.h" #include "cc/debug/devtools_instrumentation.h" -#include "cc/debug/overdraw_metrics.h" #include "cc/debug/rendering_stats_instrumentation.h" #include "cc/input/top_controls_manager.h" #include "cc/layers/heads_up_display_layer.h" @@ -903,8 +902,7 @@ void LayerTreeHost::SetPrioritiesForLayers( } void LayerTreeHost::PrioritizeTextures( - const RenderSurfaceLayerList& render_surface_layer_list, - OverdrawMetrics* metrics) { + const RenderSurfaceLayerList& render_surface_layer_list) { if (!contents_texture_manager_) return; @@ -916,11 +914,6 @@ void LayerTreeHost::PrioritizeTextures( SetPrioritiesForLayers(render_surface_layer_list); SetPrioritiesForSurfaces(memory_for_render_surfaces_metric); - metrics->DidUseContentsTextureMemoryBytes( - contents_texture_manager_->MemoryAboveCutoffBytes()); - metrics->DidUseRenderSurfaceTextureMemoryBytes( - memory_for_render_surfaces_metric); - contents_texture_manager_->PrioritizeTextures(); } @@ -983,17 +976,12 @@ void LayerTreeHost::PaintLayerContents( ResourceUpdateQueue* queue, bool* did_paint_content, bool* need_more_updates) { - bool record_metrics_for_frame = - settings_.show_overdraw_in_tracing && - base::debug::TraceLog::GetInstance() && - base::debug::TraceLog::GetInstance()->IsEnabled(); OcclusionTracker<Layer> occlusion_tracker( - root_layer_->render_surface()->content_rect(), record_metrics_for_frame); + root_layer_->render_surface()->content_rect()); occlusion_tracker.set_minimum_tracking_size( settings_.minimum_occlusion_tracking_size); - PrioritizeTextures(render_surface_layer_list, - occlusion_tracker.overdraw_metrics()); + PrioritizeTextures(render_surface_layer_list); in_paint_layer_contents_ = true; @@ -1020,8 +1008,6 @@ void LayerTreeHost::PaintLayerContents( } in_paint_layer_contents_ = false; - - occlusion_tracker.overdraw_metrics()->RecordMetrics(this); } void LayerTreeHost::ApplyScrollAndScale(const ScrollAndScaleSet& info) { diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h index e00fe5e..4564584 100644 --- a/cc/trees/layer_tree_host.h +++ b/cc/trees/layer_tree_host.h @@ -26,7 +26,6 @@ #include "cc/base/swap_promise_monitor.h" #include "cc/debug/micro_benchmark.h" #include "cc/debug/micro_benchmark_controller.h" -#include "cc/debug/overdraw_metrics.h" #include "cc/input/input_handler.h" #include "cc/input/scrollbar.h" #include "cc/input/top_controls_state.h" @@ -344,8 +343,7 @@ class CC_EXPORT LayerTreeHost { void ReduceMemoryUsage(); void PrioritizeTextures( - const RenderSurfaceLayerList& render_surface_layer_list, - OverdrawMetrics* metrics); + const RenderSurfaceLayerList& render_surface_layer_list); void SetPrioritiesForSurfaces(size_t surface_memory_bytes); void SetPrioritiesForLayers(const RenderSurfaceLayerList& update_list); size_t CalculateMemoryForRenderSurfaces( diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 91aefdd..8db96cc 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -22,7 +22,6 @@ #include "cc/debug/debug_rect_history.h" #include "cc/debug/devtools_instrumentation.h" #include "cc/debug/frame_rate_counter.h" -#include "cc/debug/overdraw_metrics.h" #include "cc/debug/paint_time_counter.h" #include "cc/debug/rendering_stats_instrumentation.h" #include "cc/debug/traced_value.h" @@ -759,13 +758,8 @@ DrawSwapReadbackResult::DrawResult LayerTreeHostImpl::CalculateRenderPasses( root_pass->damage_rect = root_pass->output_rect; } - bool record_metrics_for_frame = - settings_.show_overdraw_in_tracing && - base::debug::TraceLog::GetInstance() && - base::debug::TraceLog::GetInstance()->IsEnabled(); OcclusionTracker<LayerImpl> occlusion_tracker( - active_tree_->root_layer()->render_surface()->content_rect(), - record_metrics_for_frame); + active_tree_->root_layer()->render_surface()->content_rect()); occlusion_tracker.set_minimum_tracking_size( settings_.minimum_occlusion_tracking_size); @@ -912,11 +906,6 @@ DrawSwapReadbackResult::DrawResult LayerTreeHostImpl::CalculateRenderPasses( occlusion_tracker); } - if (draw_result == DrawSwapReadbackResult::DRAW_SUCCESS) - occlusion_tracker.overdraw_metrics()->RecordMetrics(this); - else - DCHECK(!have_copy_request); - RemoveRenderPasses(CullRenderPassesWithNoQuads(), frame); renderer_->DecideRenderPassAllocationsForFrame(frame->render_passes); diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc index bcc59d0..c89b15d 100644 --- a/cc/trees/layer_tree_settings.cc +++ b/cc/trees/layer_tree_settings.cc @@ -21,7 +21,6 @@ LayerTreeSettings::LayerTreeSettings() per_tile_painting_enabled(false), partial_swap_enabled(false), accelerated_animation_enabled(true), - show_overdraw_in_tracing(false), can_use_lcd_text(true), should_clear_root_render_pass(true), rasterization_site(CpuRasterization), diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h index 3e8f4ac..52f0d41 100644 --- a/cc/trees/layer_tree_settings.h +++ b/cc/trees/layer_tree_settings.h @@ -26,7 +26,6 @@ class CC_EXPORT LayerTreeSettings { bool per_tile_painting_enabled; bool partial_swap_enabled; bool accelerated_animation_enabled; - bool show_overdraw_in_tracing; bool can_use_lcd_text; bool should_clear_root_render_pass; enum RasterizationSite { diff --git a/cc/trees/occlusion_tracker.cc b/cc/trees/occlusion_tracker.cc index 73bb8b0..bc609cf 100644 --- a/cc/trees/occlusion_tracker.cc +++ b/cc/trees/occlusion_tracker.cc @@ -7,7 +7,6 @@ #include <algorithm> #include "cc/base/math_util.h" -#include "cc/debug/overdraw_metrics.h" #include "cc/layers/layer.h" #include "cc/layers/layer_impl.h" #include "cc/layers/render_surface.h" @@ -19,10 +18,8 @@ namespace cc { template <typename LayerType> OcclusionTracker<LayerType>::OcclusionTracker( - const gfx::Rect& screen_space_clip_rect, - bool record_metrics_for_frame) + const gfx::Rect& screen_space_clip_rect) : screen_space_clip_rect_(screen_space_clip_rect), - overdraw_metrics_(OverdrawMetrics::Create(record_metrics_for_frame)), occluding_screen_space_rects_(NULL), non_occluding_screen_space_rects_(NULL) {} diff --git a/cc/trees/occlusion_tracker.h b/cc/trees/occlusion_tracker.h index a47ce04..9a0b8a1 100644 --- a/cc/trees/occlusion_tracker.h +++ b/cc/trees/occlusion_tracker.h @@ -14,7 +14,6 @@ #include "ui/gfx/rect.h" namespace cc { -class OverdrawMetrics; class LayerImpl; class RenderSurfaceImpl; class Layer; @@ -32,8 +31,7 @@ class RenderSurface; template <typename LayerType> class CC_EXPORT OcclusionTracker { public: - OcclusionTracker(const gfx::Rect& screen_space_clip_rect, - bool record_metrics_for_frame); + explicit OcclusionTracker(const gfx::Rect& screen_space_clip_rect); ~OcclusionTracker(); // Called at the beginning of each step in the LayerIterator's front-to-back @@ -67,11 +65,6 @@ class CC_EXPORT OcclusionTracker { bool for_replica, const gfx::Rect& content_rect) const; - // Report operations for recording overdraw metrics. - OverdrawMetrics* overdraw_metrics() const { - return overdraw_metrics_.get(); - } - // Gives the region of the screen that is not occluded by something opaque. Region ComputeVisibleRegionInScreen() const { DCHECK(!stack_.back().target->parent()); @@ -139,7 +132,6 @@ class CC_EXPORT OcclusionTracker { void MarkOccludedBehindLayer(const LayerType* layer); gfx::Rect screen_space_clip_rect_; - scoped_ptr<class OverdrawMetrics> overdraw_metrics_; gfx::Size minimum_tracking_size_; // This is used for visualizing the occlusion tracking process. diff --git a/cc/trees/occlusion_tracker_perftest.cc b/cc/trees/occlusion_tracker_perftest.cc index 4961f29..8e3bc48 100644 --- a/cc/trees/occlusion_tracker_perftest.cc +++ b/cc/trees/occlusion_tracker_perftest.cc @@ -71,7 +71,7 @@ TEST_F(OcclusionTrackerPerfTest, UnoccludedContentRect_FullyOccluded) { SetTestName("unoccluded_content_rect_fully_occluded"); gfx::Rect viewport_rect(768, 1038); - OcclusionTracker<LayerImpl> tracker(viewport_rect, false); + OcclusionTracker<LayerImpl> tracker(viewport_rect); CreateHost(); host_impl_->SetViewportSize(viewport_rect.size()); @@ -137,7 +137,7 @@ TEST_F(OcclusionTrackerPerfTest, UnoccludedContentRect_10OpaqueLayers) { SetTestName("unoccluded_content_rect_10_opaque_layers"); gfx::Rect viewport_rect(768, 1038); - OcclusionTracker<LayerImpl> tracker(viewport_rect, false); + OcclusionTracker<LayerImpl> tracker(viewport_rect); CreateHost(); host_impl_->SetViewportSize(viewport_rect.size()); diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc index a9c3d4b..f4e2edb 100644 --- a/cc/trees/occlusion_tracker_unittest.cc +++ b/cc/trees/occlusion_tracker_unittest.cc @@ -6,7 +6,6 @@ #include "cc/animation/layer_animation_controller.h" #include "cc/base/math_util.h" -#include "cc/debug/overdraw_metrics.h" #include "cc/layers/layer.h" #include "cc/layers/layer_impl.h" #include "cc/output/copy_output_request.h" @@ -76,12 +75,8 @@ class TestContentLayerImpl : public LayerImpl { template <typename LayerType> class TestOcclusionTrackerWithClip : public TestOcclusionTracker<LayerType> { public: - TestOcclusionTrackerWithClip(const gfx::Rect& viewport_rect, - bool record_metrics_for_frame) - : TestOcclusionTracker<LayerType>(viewport_rect, - record_metrics_for_frame) {} explicit TestOcclusionTrackerWithClip(const gfx::Rect& viewport_rect) - : TestOcclusionTracker<LayerType>(viewport_rect, false) {} + : TestOcclusionTracker<LayerType>(viewport_rect) {} bool OccludedLayer(const LayerType* layer, const gfx::Rect& content_rect) const { @@ -531,7 +526,7 @@ class OcclusionTrackerTestIdentityTransforms this->CalcDrawEtc(root); TestOcclusionTrackerWithClip<typename Types::LayerType> occlusion( - gfx::Rect(0, 0, 1000, 1000), false); + gfx::Rect(0, 0, 1000, 1000)); this->VisitLayer(layer, &occlusion); this->EnterLayer(parent, &occlusion); @@ -3715,7 +3710,7 @@ class OcclusionTrackerTestEmptyEventLayerDoesNotOcclude this->CalcDrawEtc(root); TestOcclusionTrackerWithClip<typename Types::LayerType> occlusion( - gfx::Rect(0, 0, 1000, 1000), false); + gfx::Rect(0, 0, 1000, 1000)); this->VisitLayer(empty_layer, &occlusion); diff --git a/cc/trees/quad_culler.cc b/cc/trees/quad_culler.cc index bfd99d3..b4ab693 100644 --- a/cc/trees/quad_culler.cc +++ b/cc/trees/quad_culler.cc @@ -5,7 +5,6 @@ #include "cc/trees/quad_culler.h" #include "cc/debug/debug_colors.h" -#include "cc/debug/overdraw_metrics.h" #include "cc/layers/append_quads_data.h" #include "cc/layers/layer_impl.h" #include "cc/quads/debug_border_draw_quad.h" @@ -51,13 +50,6 @@ static inline bool AppendQuadInternal( if (keep_quad) draw_quad->visible_rect = culled_rect; - occlusion_tracker.overdraw_metrics()->DidCullForDrawing( - draw_quad->quadTransform(), draw_quad->rect, culled_rect); - gfx::Rect opaque_draw_rect = - draw_quad->opacity() == 1.0f ? draw_quad->opaque_rect : gfx::Rect(); - occlusion_tracker.overdraw_metrics()-> - DidDraw(draw_quad->quadTransform(), culled_rect, opaque_draw_rect); - if (keep_quad) { if (create_debug_border_quads && !draw_quad->IsDebugQuad() && draw_quad->visible_rect != draw_quad->rect) { diff --git a/cc/trees/quad_culler_unittest.cc b/cc/trees/quad_culler_unittest.cc index d7cd99ab..08195e6 100644 --- a/cc/trees/quad_culler_unittest.cc +++ b/cc/trees/quad_culler_unittest.cc @@ -7,7 +7,6 @@ #include <vector> #include "cc/base/math_util.h" -#include "cc/debug/overdraw_metrics.h" #include "cc/layers/append_quads_data.h" #include "cc/layers/render_surface_impl.h" #include "cc/layers/tiled_layer_impl.h" @@ -138,9 +137,8 @@ TEST_F(QuadCullerTest, NoCulling) { false, gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -154,13 +152,6 @@ TEST_F(QuadCullerTest, NoCulling) { &it, &occlusion_tracker); EXPECT_EQ(13u, quad_list.size()); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 90000, 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), - 40000, - 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), 0, 1); } TEST_F(QuadCullerTest, CullChildLinesUpTopLeft) { @@ -180,9 +171,8 @@ TEST_F(QuadCullerTest, CullChildLinesUpTopLeft) { true, gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -196,13 +186,6 @@ TEST_F(QuadCullerTest, CullChildLinesUpTopLeft) { &it, &occlusion_tracker); EXPECT_EQ(9u, quad_list.size()); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 90000, 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), 0, 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), - 40000, - 1); } TEST_F(QuadCullerTest, CullWhenChildOpacityNotOne) { @@ -222,9 +205,8 @@ TEST_F(QuadCullerTest, CullWhenChildOpacityNotOne) { true, gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -238,13 +220,6 @@ TEST_F(QuadCullerTest, CullWhenChildOpacityNotOne) { &it, &occlusion_tracker); EXPECT_EQ(13u, quad_list.size()); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 90000, 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), - 40000, - 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), 0, 1); } TEST_F(QuadCullerTest, CullWhenChildOpaqueFlagFalse) { @@ -264,9 +239,8 @@ TEST_F(QuadCullerTest, CullWhenChildOpaqueFlagFalse) { false, gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -280,13 +254,6 @@ TEST_F(QuadCullerTest, CullWhenChildOpaqueFlagFalse) { &it, &occlusion_tracker); EXPECT_EQ(13u, quad_list.size()); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 90000, 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), - 40000, - 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), 0, 1); } TEST_F(QuadCullerTest, CullCenterTileOnly) { @@ -307,9 +274,8 @@ TEST_F(QuadCullerTest, CullCenterTileOnly) { true, gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -338,14 +304,6 @@ TEST_F(QuadCullerTest, CullCenterTileOnly) { gfx::Rect quad_visible_rect6 = quad_list[10]->visible_rect; EXPECT_EQ(50, quad_visible_rect6.height()); EXPECT_EQ(250, quad_visible_rect6.y()); - - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 100000, 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), 0, 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), - 30000, - 1); } TEST_F(QuadCullerTest, CullCenterTileNonIntegralSize1) { @@ -375,9 +333,8 @@ TEST_F(QuadCullerTest, CullCenterTileNonIntegralSize1) { true, gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -391,13 +348,6 @@ TEST_F(QuadCullerTest, CullCenterTileNonIntegralSize1) { &it, &occlusion_tracker); EXPECT_EQ(2u, quad_list.size()); - - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 20363, 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), 0, 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), 0, 1); } TEST_F(QuadCullerTest, CullCenterTileNonIntegralSize2) { @@ -428,9 +378,8 @@ TEST_F(QuadCullerTest, CullCenterTileNonIntegralSize2) { true, gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -444,13 +393,6 @@ TEST_F(QuadCullerTest, CullCenterTileNonIntegralSize2) { &it, &occlusion_tracker); EXPECT_EQ(2u, quad_list.size()); - - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 19643, 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), 0, 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), 0, 1); } TEST_F(QuadCullerTest, CullChildLinesUpBottomRight) { @@ -471,9 +413,8 @@ TEST_F(QuadCullerTest, CullChildLinesUpBottomRight) { true, gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -487,13 +428,6 @@ TEST_F(QuadCullerTest, CullChildLinesUpBottomRight) { &it, &occlusion_tracker); EXPECT_EQ(9u, quad_list.size()); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 90000, 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), 0, 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), - 40000, - 1); } TEST_F(QuadCullerTest, CullSubRegion) { @@ -518,9 +452,8 @@ TEST_F(QuadCullerTest, CullSubRegion) { false, child_opaque_rect, render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -534,14 +467,6 @@ TEST_F(QuadCullerTest, CullSubRegion) { &it, &occlusion_tracker); EXPECT_EQ(12u, quad_list.size()); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 90000, 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), - 30000, - 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), - 10000, - 1); } TEST_F(QuadCullerTest, CullSubRegion2) { @@ -566,9 +491,8 @@ TEST_F(QuadCullerTest, CullSubRegion2) { false, child_opaque_rect, render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -582,14 +506,6 @@ TEST_F(QuadCullerTest, CullSubRegion2) { &it, &occlusion_tracker); EXPECT_EQ(12u, quad_list.size()); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 90000, 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), - 25000, - 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), - 15000, - 1); } TEST_F(QuadCullerTest, CullSubRegionCheckOvercull) { @@ -614,9 +530,8 @@ TEST_F(QuadCullerTest, CullSubRegionCheckOvercull) { false, child_opaque_rect, render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -630,14 +545,6 @@ TEST_F(QuadCullerTest, CullSubRegionCheckOvercull) { &it, &occlusion_tracker); EXPECT_EQ(13u, quad_list.size()); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 90000, 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), - 30000, - 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), - 10000, - 1); } TEST_F(QuadCullerTest, NonAxisAlignedQuadsDontOcclude) { @@ -660,9 +567,8 @@ TEST_F(QuadCullerTest, NonAxisAlignedQuadsDontOcclude) { true, gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -676,12 +582,6 @@ TEST_F(QuadCullerTest, NonAxisAlignedQuadsDontOcclude) { &it, &occlusion_tracker); EXPECT_EQ(13u, quad_list.size()); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 130000, 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), 0, 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), 0, 1); } // This test requires some explanation: here we are rotating the quads to be @@ -711,9 +611,8 @@ TEST_F(QuadCullerTest, NonAxisAlignedQuadsSafelyCulled) { true, gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); + gfx::Rect(-100, -100, 1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); AppendQuads(&quad_list, @@ -727,53 +626,6 @@ TEST_F(QuadCullerTest, NonAxisAlignedQuadsSafelyCulled) { &it, &occlusion_tracker); EXPECT_EQ(12u, quad_list.size()); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque(), 100600, 1); - EXPECT_NEAR( - occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent(), 0, 1); - EXPECT_NEAR(occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing(), - 29400, - 1); -} - -TEST_F(QuadCullerTest, WithoutMetrics) { - DECLARE_AND_INITIALIZE_TEST_QUADS(); - scoped_ptr<TiledLayerImpl> root_layer = MakeLayer(NULL, - gfx::Transform(), - root_rect, - 1.f, - true, - gfx::Rect(), - render_surface_layer_list); - scoped_ptr<TiledLayerImpl> child_layer = MakeLayer(root_layer.get(), - gfx::Transform(), - child_rect, - 1.f, - true, - gfx::Rect(), - render_surface_layer_list); - bool record_metrics = false; - TestOcclusionTracker<LayerImpl> occlusion_tracker( - gfx::Rect(-100, -100, 1000, 1000), record_metrics); - LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); - - AppendQuads(&quad_list, - &shared_state_list, - child_layer.get(), - &it, - &occlusion_tracker); - AppendQuads(&quad_list, - &shared_state_list, - root_layer.get(), - &it, - &occlusion_tracker); - EXPECT_EQ(9u, quad_list.size()); - EXPECT_EQ(0.f, - occlusion_tracker.overdraw_metrics()->pixels_drawn_opaque()); - EXPECT_EQ(0.f, - occlusion_tracker.overdraw_metrics()->pixels_drawn_translucent()); - EXPECT_EQ(0.f, - occlusion_tracker.overdraw_metrics()->pixels_culled_for_drawing()); } TEST_F(QuadCullerTest, PartialCullingNotDestroyed) { @@ -787,9 +639,7 @@ TEST_F(QuadCullerTest, PartialCullingNotDestroyed) { gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; - TestOcclusionTracker<LayerImpl> occlusion_tracker(gfx::Rect(1000, 1000), - record_metrics); + TestOcclusionTracker<LayerImpl> occlusion_tracker(gfx::Rect(1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); QuadCuller culler(&quad_list, @@ -865,9 +715,7 @@ TEST_F(QuadCullerTest, PartialCullingWithOcclusionNotDestroyed) { gfx::Rect(), render_surface_layer_list); - bool record_metrics = true; - TestOcclusionTracker<LayerImpl> occlusion_tracker(gfx::Rect(1000, 1000), - record_metrics); + TestOcclusionTracker<LayerImpl> occlusion_tracker(gfx::Rect(1000, 1000)); LayerIteratorType it = LayerIteratorType::Begin(&render_surface_layer_list); QuadCuller culler(&quad_list, diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index 3e75e25..e7467f3 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc @@ -183,7 +183,6 @@ std::string DeriveCommandLine(const GURL& start_url, cc::switches::kShowScreenSpaceRects, cc::switches::kShowSurfaceDamageRects, cc::switches::kSlowDownRasterScaleFactor, - cc::switches::kTraceOverdraw, cc::switches::kUIDisablePartialSwap, chromeos::switches::kDbusStub, chromeos::switches::kDisableLoginAnimations, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index f677540..1efb030 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1144,7 +1144,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( cc::switches::kTopControlsHeight, cc::switches::kTopControlsHideThreshold, cc::switches::kTopControlsShowThreshold, - cc::switches::kTraceOverdraw, #if defined(ENABLE_PLUGINS) switches::kEnablePepperTesting, #endif diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index d66e717..455540f 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -171,8 +171,6 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create( settings.top_controls_hide_threshold = hide_threshold; } - settings.show_overdraw_in_tracing = - cmd->HasSwitch(cc::switches::kTraceOverdraw); settings.can_use_lcd_text = RenderThreadImpl::current()->is_lcd_text_enabled(); settings.use_pinch_virtual_viewport = |