summaryrefslogtreecommitdiffstats
path: root/cc/layers
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-27 06:15:21 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-27 06:15:21 +0000
commitd5e16c0ce64a8e86df9a3a576e0b26b3622f014a (patch)
tree4caa46dad5b493b65a136818b7eaebf1f1b830ea /cc/layers
parentc600f5c6c9d3e9fb4b82dfc41b9ec000c9cb284d (diff)
downloadchromium_src-d5e16c0ce64a8e86df9a3a576e0b26b3622f014a.zip
chromium_src-d5e16c0ce64a8e86df9a3a576e0b26b3622f014a.tar.gz
chromium_src-d5e16c0ce64a8e86df9a3a576e0b26b3622f014a.tar.bz2
Revert 190817 "cc: Switch RenderingStats collection in Layer::Up..."
> cc: Switch RenderingStats collection in Layer::Update() to RenderingStatsInstrumentation > > This change switches all of the remaining RenderingStats collection in > composited mode to use RenderinStatsInstrumentation. > > BUG=181319 > > > Review URL: https://chromiumcodereview.appspot.com/12426024 TBR=egraether@chromium.org Review URL: https://codereview.chromium.org/13117002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190826 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers')
-rw-r--r--cc/layers/content_layer.cc17
-rw-r--r--cc/layers/content_layer.h3
-rw-r--r--cc/layers/content_layer_unittest.cc10
-rw-r--r--cc/layers/contents_scaling_layer.cc3
-rw-r--r--cc/layers/contents_scaling_layer.h3
-rw-r--r--cc/layers/heads_up_display_layer.cc3
-rw-r--r--cc/layers/heads_up_display_layer.h3
-rw-r--r--cc/layers/image_layer.cc5
-rw-r--r--cc/layers/image_layer.h3
-rw-r--r--cc/layers/layer.cc4
-rw-r--r--cc/layers/layer.h7
-rw-r--r--cc/layers/nine_patch_layer.cc3
-rw-r--r--cc/layers/nine_patch_layer.h3
-rw-r--r--cc/layers/nine_patch_layer_unittest.cc10
-rw-r--r--cc/layers/picture_layer.cc5
-rw-r--r--cc/layers/picture_layer.h4
-rw-r--r--cc/layers/picture_layer_impl_unittest.cc4
-rw-r--r--cc/layers/scrollbar_layer.cc31
-rw-r--r--cc/layers/scrollbar_layer.h6
-rw-r--r--cc/layers/scrollbar_layer_unittest.cc2
-rw-r--r--cc/layers/texture_layer.cc3
-rw-r--r--cc/layers/texture_layer.h3
-rw-r--r--cc/layers/tiled_layer.cc30
-rw-r--r--cc/layers/tiled_layer.h7
-rw-r--r--cc/layers/tiled_layer_unittest.cc75
25 files changed, 128 insertions, 119 deletions
diff --git a/cc/layers/content_layer.cc b/cc/layers/content_layer.cc
index 4ad1bc7..c29d72e 100644
--- a/cc/layers/content_layer.cc
+++ b/cc/layers/content_layer.cc
@@ -68,7 +68,8 @@ void ContentLayer::SetTexturePriorities(
}
void ContentLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) {
{
base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_,
true);
@@ -77,7 +78,7 @@ void ContentLayer::Update(ResourceUpdateQueue* queue,
UpdateCanUseLCDText();
}
- TiledLayer::Update(queue, occlusion);
+ TiledLayer::Update(queue, occlusion, stats);
needs_display_ = false;
}
@@ -95,17 +96,11 @@ void ContentLayer::CreateUpdaterIfNeeded() {
scoped_ptr<LayerPainter> painter =
ContentLayerPainter::Create(client_).PassAs<LayerPainter>();
if (layer_tree_host()->settings().accelerate_painting)
- updater_ = SkPictureContentLayerUpdater::Create(
- painter.Pass(),
- rendering_stats_instrumentation());
+ updater_ = SkPictureContentLayerUpdater::Create(painter.Pass());
else if (layer_tree_host()->settings().per_tile_painting_enabled)
- updater_ = BitmapSkPictureContentLayerUpdater::Create(
- painter.Pass(),
- rendering_stats_instrumentation());
+ updater_ = BitmapSkPictureContentLayerUpdater::Create(painter.Pass());
else
- updater_ = BitmapContentLayerUpdater::Create(
- painter.Pass(),
- rendering_stats_instrumentation());
+ updater_ = BitmapContentLayerUpdater::Create(painter.Pass());
updater_->SetOpaque(contents_opaque());
unsigned texture_format =
diff --git a/cc/layers/content_layer.h b/cc/layers/content_layer.h
index 0f00cfd..79394de 100644
--- a/cc/layers/content_layer.h
+++ b/cc/layers/content_layer.h
@@ -44,7 +44,8 @@ class CC_EXPORT ContentLayer : public TiledLayer {
virtual void SetTexturePriorities(const PriorityCalculator& priority_calc)
OVERRIDE;
virtual void Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) OVERRIDE;
virtual bool NeedMoreUpdates() OVERRIDE;
virtual void SetContentsOpaque(bool contents_opaque) OVERRIDE;
diff --git a/cc/layers/content_layer_unittest.cc b/cc/layers/content_layer_unittest.cc
index b1c6a11..25421e7 100644
--- a/cc/layers/content_layer_unittest.cc
+++ b/cc/layers/content_layer_unittest.cc
@@ -6,7 +6,6 @@
#include "cc/layers/content_layer_client.h"
#include "cc/resources/bitmap_content_layer_updater.h"
-#include "cc/test/fake_rendering_stats_instrumentation.h"
#include "cc/test/geometry_test_utils.h"
#include "skia/ext/platform_canvas.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -38,18 +37,17 @@ TEST(ContentLayerTest, ContentLayerPainterWithDeviceScale) {
gfx::RectF opaque_rect_in_content_space = gfx::ScaleRect(
opaque_rect_in_layer_space, contents_scale, contents_scale);
MockContentLayerClient client(opaque_rect_in_layer_space);
- FakeRenderingStatsInstrumentation stats_instrumentation;
scoped_refptr<BitmapContentLayerUpdater> updater =
- BitmapContentLayerUpdater::Create(
- ContentLayerPainter::Create(&client).PassAs<LayerPainter>(),
- &stats_instrumentation);
+ BitmapContentLayerUpdater::Create(ContentLayerPainter::Create(&client).
+ PassAs<LayerPainter>());
gfx::Rect resulting_opaque_rect;
updater->PrepareToUpdate(content_rect,
gfx::Size(256, 256),
contents_scale,
contents_scale,
- &resulting_opaque_rect);
+ &resulting_opaque_rect,
+ NULL);
EXPECT_RECT_EQ(gfx::ToEnclosingRect(opaque_rect_in_content_space),
resulting_opaque_rect);
diff --git a/cc/layers/contents_scaling_layer.cc b/cc/layers/contents_scaling_layer.cc
index 01abcfe..d602e88 100644
--- a/cc/layers/contents_scaling_layer.cc
+++ b/cc/layers/contents_scaling_layer.cc
@@ -35,7 +35,8 @@ void ContentsScalingLayer::CalculateContentsScale(
void ContentsScalingLayer::Update(
ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) {
if (draw_properties().contents_scale_x == last_update_contents_scale_x_ &&
draw_properties().contents_scale_y == last_update_contents_scale_y_)
return;
diff --git a/cc/layers/contents_scaling_layer.h b/cc/layers/contents_scaling_layer.h
index df853ec..a550c26 100644
--- a/cc/layers/contents_scaling_layer.h
+++ b/cc/layers/contents_scaling_layer.h
@@ -23,7 +23,8 @@ class CC_EXPORT ContentsScalingLayer : public Layer {
virtual void Update(
ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) OVERRIDE;
protected:
ContentsScalingLayer();
diff --git a/cc/layers/heads_up_display_layer.cc b/cc/layers/heads_up_display_layer.cc
index 9945178..76016b5 100644
--- a/cc/layers/heads_up_display_layer.cc
+++ b/cc/layers/heads_up_display_layer.cc
@@ -23,7 +23,8 @@ HeadsUpDisplayLayer::HeadsUpDisplayLayer() : Layer() {
HeadsUpDisplayLayer::~HeadsUpDisplayLayer() {}
void HeadsUpDisplayLayer::Update(ResourceUpdateQueue*,
- const OcclusionTracker*) {
+ const OcclusionTracker*,
+ RenderingStats*) {
const LayerTreeDebugState& debug_state = layer_tree_host()->debug_state();
int max_texture_size =
layer_tree_host()->GetRendererCapabilities().max_texture_size;
diff --git a/cc/layers/heads_up_display_layer.h b/cc/layers/heads_up_display_layer.h
index 03d29a02..d7656c5 100644
--- a/cc/layers/heads_up_display_layer.h
+++ b/cc/layers/heads_up_display_layer.h
@@ -16,7 +16,8 @@ class CC_EXPORT HeadsUpDisplayLayer : public Layer {
static scoped_refptr<HeadsUpDisplayLayer> Create();
virtual void Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* tracker) OVERRIDE;
+ const OcclusionTracker* tracker,
+ RenderingStats* stats) OVERRIDE;
virtual bool DrawsContent() const OVERRIDE;
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
diff --git a/cc/layers/image_layer.cc b/cc/layers/image_layer.cc
index 59cf913..4f5e105 100644
--- a/cc/layers/image_layer.cc
+++ b/cc/layers/image_layer.cc
@@ -41,7 +41,8 @@ void ImageLayer::SetTexturePriorities(const PriorityCalculator& priority_calc) {
}
void ImageLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) {
CreateUpdaterIfNeeded();
if (needs_display_) {
updater_->set_bitmap(bitmap_);
@@ -49,7 +50,7 @@ void ImageLayer::Update(ResourceUpdateQueue* queue,
InvalidateContentRect(gfx::Rect(content_bounds()));
needs_display_ = false;
}
- TiledLayer::Update(queue, occlusion);
+ TiledLayer::Update(queue, occlusion, stats);
}
void ImageLayer::CreateUpdaterIfNeeded() {
diff --git a/cc/layers/image_layer.h b/cc/layers/image_layer.h
index 25ddf12..8ba5b78 100644
--- a/cc/layers/image_layer.h
+++ b/cc/layers/image_layer.h
@@ -23,7 +23,8 @@ class CC_EXPORT ImageLayer : public TiledLayer {
virtual void SetTexturePriorities(const PriorityCalculator& priority_calc)
OVERRIDE;
virtual void Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) OVERRIDE;
virtual void CalculateContentsScale(float ideal_contents_scale,
bool animating_transform_to_screen,
float* contents_scale_x,
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index c5a2ad8..bdd2a4f 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -818,8 +818,4 @@ ScrollbarLayer* Layer::ToScrollbarLayer() {
return NULL;
}
-RenderingStatsInstrumentation* Layer::rendering_stats_instrumentation() const {
- return layer_tree_host_->rendering_stats_instrumentation();
-}
-
} // namespace cc
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 6a1f3b2..2e72e63 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -43,7 +43,7 @@ class PriorityCalculator;
class ResourceUpdateQueue;
class ScrollbarLayer;
struct AnimationEvent;
-class RenderingStatsInstrumentation;
+struct RenderingStats;
// Base class for composited layers. Special layer types are derived from
// this class.
@@ -267,7 +267,8 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
// These methods typically need to be overwritten by derived classes.
virtual bool DrawsContent() const;
virtual void Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {}
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) {}
virtual bool NeedMoreUpdates();
virtual void SetIsMask(bool is_mask) {}
@@ -369,8 +370,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
bool NeedsDisplayForTesting() const { return needs_display_; }
void ResetNeedsDisplayForTesting() { needs_display_ = false; }
- RenderingStatsInstrumentation* rendering_stats_instrumentation() const;
-
protected:
friend class LayerImpl;
friend class TreeSynchronizer;
diff --git a/cc/layers/nine_patch_layer.cc b/cc/layers/nine_patch_layer.cc
index 9a5022d..45c69eb 100644
--- a/cc/layers/nine_patch_layer.cc
+++ b/cc/layers/nine_patch_layer.cc
@@ -57,7 +57,8 @@ void NinePatchLayer::SetBitmap(const SkBitmap& bitmap, gfx::Rect aperture) {
}
void NinePatchLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) {
CreateUpdaterIfNeeded();
if (resource_ &&
diff --git a/cc/layers/nine_patch_layer.h b/cc/layers/nine_patch_layer.h
index eaa7a1a6..21b8cb9 100644
--- a/cc/layers/nine_patch_layer.h
+++ b/cc/layers/nine_patch_layer.h
@@ -24,7 +24,8 @@ class CC_EXPORT NinePatchLayer : public Layer {
virtual void SetTexturePriorities(const PriorityCalculator& priority_calc)
OVERRIDE;
virtual void Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) OVERRIDE;
virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
// aperture is in the pixel space of the bitmap resource and refers to
diff --git a/cc/layers/nine_patch_layer_unittest.cc b/cc/layers/nine_patch_layer_unittest.cc
index 84c5348..a274100 100644
--- a/cc/layers/nine_patch_layer_unittest.cc
+++ b/cc/layers/nine_patch_layer_unittest.cc
@@ -73,7 +73,7 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) {
// No bitmap set should not trigger any uploads.
test_layer->SetTexturePriorities(calculator);
- test_layer->Update(&queue, &occlusion_tracker);
+ test_layer->Update(&queue, &occlusion_tracker, NULL);
EXPECT_EQ(queue.FullUploadSize(), 0);
EXPECT_EQ(queue.PartialUploadSize(), 0);
@@ -83,7 +83,7 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) {
bitmap.allocPixels();
test_layer->SetBitmap(bitmap, gfx::Rect(5, 5, 1, 1));
test_layer->SetTexturePriorities(calculator);
- test_layer->Update(&queue, &occlusion_tracker);
+ test_layer->Update(&queue, &occlusion_tracker, NULL);
EXPECT_EQ(queue.FullUploadSize(), 1);
EXPECT_EQ(queue.PartialUploadSize(), 0);
ResourceUpdate params = queue.TakeFirstFullUpload();
@@ -107,7 +107,7 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) {
// Nothing changed, so no repeated upload.
test_layer->SetTexturePriorities(calculator);
- test_layer->Update(&queue, &occlusion_tracker);
+ test_layer->Update(&queue, &occlusion_tracker, NULL);
EXPECT_EQ(queue.FullUploadSize(), 0);
EXPECT_EQ(queue.PartialUploadSize(), 0);
{
@@ -119,7 +119,7 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) {
// Reupload after eviction
test_layer->SetTexturePriorities(calculator);
- test_layer->Update(&queue, &occlusion_tracker);
+ test_layer->Update(&queue, &occlusion_tracker, NULL);
EXPECT_EQ(queue.FullUploadSize(), 1);
EXPECT_EQ(queue.PartialUploadSize(), 0);
@@ -129,7 +129,7 @@ TEST_F(NinePatchLayerTest, TriggerFullUploadOnceWhenChangingBitmap) {
EXPECT_EQ(NULL, params.texture->resource_manager());
test_layer->SetTexturePriorities(calculator);
ResourceUpdateQueue queue2;
- test_layer->Update(&queue2, &occlusion_tracker);
+ test_layer->Update(&queue2, &occlusion_tracker, NULL);
EXPECT_EQ(queue2.FullUploadSize(), 1);
EXPECT_EQ(queue2.PartialUploadSize(), 0);
params = queue2.TakeFirstFullUpload();
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index 732f811..c6f341a 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -68,7 +68,8 @@ void PictureLayer::SetNeedsDisplayRect(const gfx::RectF& layer_rect) {
}
void PictureLayer::Update(ResourceUpdateQueue*,
- const OcclusionTracker*) {
+ const OcclusionTracker*,
+ RenderingStats* stats) {
// Do not early-out of this function so that PicturePile::Update has a chance
// to record pictures due to changing visibility of this layer.
@@ -86,7 +87,7 @@ void PictureLayer::Update(ResourceUpdateQueue*,
background_color(),
pile_invalidation_,
visible_layer_rect,
- rendering_stats_instrumentation());
+ stats);
}
void PictureLayer::SetIsMask(bool is_mask) {
diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h
index 7dde9bc..0ba4031 100644
--- a/cc/layers/picture_layer.h
+++ b/cc/layers/picture_layer.h
@@ -15,6 +15,7 @@ namespace cc {
class ContentLayerClient;
class ResourceUpdateQueue;
+struct RenderingStats;
class CC_EXPORT PictureLayer : public ContentsScalingLayer {
public:
@@ -31,7 +32,8 @@ class CC_EXPORT PictureLayer : public ContentsScalingLayer {
virtual void SetNeedsDisplayRect(const gfx::RectF& layer_rect) OVERRIDE;
virtual void Update(
ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) OVERRIDE;
virtual void SetIsMask(bool is_mask) OVERRIDE;
protected:
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index afbb597..962d927 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -11,7 +11,6 @@
#include "cc/test/fake_impl_proxy.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_output_surface.h"
-#include "cc/test/fake_rendering_stats_instrumentation.h"
#include "cc/test/impl_side_painting_settings.h"
#include "cc/trees/layer_tree_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -96,8 +95,7 @@ class TestablePicturePileImpl : public PicturePileImpl {
return;
gfx::Rect bounds(tiling().TileBounds(x, y));
scoped_refptr<Picture> picture(Picture::Create(bounds));
- FakeRenderingStatsInstrumentation stats_instrumentation;
- picture->Record(&client_, &stats_instrumentation, tile_grid_info_);
+ picture->Record(&client_, NULL, tile_grid_info_);
picture_list_map_[std::pair<int, int>(x, y)].push_back(picture);
EXPECT_TRUE(HasRecordingAt(x, y));
diff --git a/cc/layers/scrollbar_layer.cc b/cc/layers/scrollbar_layer.cc
index 1bf71e6..c5f15b7 100644
--- a/cc/layers/scrollbar_layer.cc
+++ b/cc/layers/scrollbar_layer.cc
@@ -270,8 +270,7 @@ void ScrollbarLayer::CreateUpdaterIfNeeded() {
scrollbar_.get(),
painter_.get(),
geometry_.get(),
- WebKit::WebScrollbar::BackTrackPart).PassAs<LayerPainter>(),
- rendering_stats_instrumentation());
+ WebKit::WebScrollbar::BackTrackPart).PassAs<LayerPainter>());
}
if (!back_track_) {
back_track_ = back_track_updater_->CreateResource(
@@ -287,8 +286,7 @@ void ScrollbarLayer::CreateUpdaterIfNeeded() {
scrollbar_.get(),
painter_.get(),
geometry_.get(),
- WebKit::WebScrollbar::ForwardTrackPart).PassAs<LayerPainter>(),
- rendering_stats_instrumentation());
+ WebKit::WebScrollbar::ForwardTrackPart).PassAs<LayerPainter>());
}
if (!fore_track_) {
fore_track_ = fore_track_updater_->CreateResource(
@@ -300,8 +298,7 @@ void ScrollbarLayer::CreateUpdaterIfNeeded() {
thumb_updater_ = CachingBitmapContentLayerUpdater::Create(
ScrollbarThumbPainter::Create(scrollbar_.get(),
painter_.get(),
- geometry_.get()).PassAs<LayerPainter>(),
- rendering_stats_instrumentation());
+ geometry_.get()).PassAs<LayerPainter>());
}
if (!thumb_) {
thumb_ = thumb_updater_->CreateResource(
@@ -312,7 +309,8 @@ void ScrollbarLayer::CreateUpdaterIfNeeded() {
void ScrollbarLayer::UpdatePart(CachingBitmapContentLayerUpdater* painter,
LayerUpdater::Resource* resource,
gfx::Rect rect,
- ResourceUpdateQueue* queue) {
+ ResourceUpdateQueue* queue,
+ RenderingStats* stats) {
if (layer_tree_host()->settings().solid_color_scrollbars)
return;
@@ -334,7 +332,8 @@ void ScrollbarLayer::UpdatePart(CachingBitmapContentLayerUpdater* painter,
rect.size(),
contents_scale_x(),
contents_scale_y(),
- &painted_opaque_rect);
+ &painted_opaque_rect,
+ stats);
if (!painter->pixels_did_change() &&
resource->texture()->have_backing_texture()) {
TRACE_EVENT_INSTANT0("cc",
@@ -349,7 +348,7 @@ void ScrollbarLayer::UpdatePart(CachingBitmapContentLayerUpdater* painter,
resource->texture()->ReturnBackingTexture();
gfx::Vector2d dest_offset(0, 0);
- resource->Update(queue, rect, dest_offset, partial_updates_allowed);
+ resource->Update(queue, rect, dest_offset, partial_updates_allowed, stats);
}
gfx::Rect ScrollbarLayer::ScrollbarLayerRectToContentRect(
@@ -396,8 +395,9 @@ void ScrollbarLayer::SetTexturePriorities(
}
void ScrollbarLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {
- ContentsScalingLayer::Update(queue, occlusion);
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) {
+ ContentsScalingLayer::Update(queue, occlusion, stats);
dirty_rect_.Union(update_rect_);
if (content_bounds().IsEmpty())
@@ -412,12 +412,14 @@ void ScrollbarLayer::Update(ResourceUpdateQueue* queue,
UpdatePart(back_track_updater_.get(),
back_track_.get(),
content_rect,
- queue);
+ queue,
+ stats);
if (fore_track_ && fore_track_updater_) {
UpdatePart(fore_track_updater_.get(),
fore_track_.get(),
content_rect,
- queue);
+ queue,
+ stats);
}
// Consider the thumb to be at the origin when painting.
@@ -429,7 +431,8 @@ void ScrollbarLayer::Update(ResourceUpdateQueue* queue,
UpdatePart(thumb_updater_.get(),
thumb_.get(),
origin_thumb_rect,
- queue);
+ queue,
+ stats);
}
dirty_rect_ = gfx::RectF();
diff --git a/cc/layers/scrollbar_layer.h b/cc/layers/scrollbar_layer.h
index 7920964..db97272 100644
--- a/cc/layers/scrollbar_layer.h
+++ b/cc/layers/scrollbar_layer.h
@@ -40,7 +40,8 @@ class CC_EXPORT ScrollbarLayer : public ContentsScalingLayer {
virtual void SetTexturePriorities(const PriorityCalculator& priority_calc)
OVERRIDE;
virtual void Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) OVERRIDE;
virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE;
virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
virtual void CalculateContentsScale(float ideal_contents_scale,
@@ -63,7 +64,8 @@ class CC_EXPORT ScrollbarLayer : public ContentsScalingLayer {
void UpdatePart(CachingBitmapContentLayerUpdater* painter,
LayerUpdater::Resource* resource,
gfx::Rect rect,
- ResourceUpdateQueue* queue);
+ ResourceUpdateQueue* queue,
+ RenderingStats* stats);
void CreateUpdaterIfNeeded();
gfx::Rect ScrollbarLayerRectToContentRect(gfx::Rect layer_rect) const;
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index 1258a8c..779abf1 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -392,7 +392,7 @@ class ScrollbarLayerTestResourceCreation : public testing::Test {
scrollbar_layer->SetTexturePriorities(calculator);
layer_tree_host_->contents_texture_manager()->PrioritizeTextures();
- scrollbar_layer->Update(&queue, &occlusion_tracker);
+ scrollbar_layer->Update(&queue, &occlusion_tracker, NULL);
EXPECT_EQ(0, queue.FullUploadSize());
EXPECT_EQ(expected_resources, queue.PartialUploadSize());
diff --git a/cc/layers/texture_layer.cc b/cc/layers/texture_layer.cc
index 4d63f72..acabc87 100644
--- a/cc/layers/texture_layer.cc
+++ b/cc/layers/texture_layer.cc
@@ -155,7 +155,8 @@ bool TextureLayer::DrawsContent() const {
}
void TextureLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) {
if (client_) {
texture_id_ = client_->PrepareTexture(queue);
context_lost_ =
diff --git a/cc/layers/texture_layer.h b/cc/layers/texture_layer.h
index 28994f3..1e7b31b 100644
--- a/cc/layers/texture_layer.h
+++ b/cc/layers/texture_layer.h
@@ -70,7 +70,8 @@ class CC_EXPORT TextureLayer : public Layer {
virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE;
virtual bool DrawsContent() const OVERRIDE;
virtual void Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) OVERRIDE;
virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
virtual bool BlocksPendingCommit() const OVERRIDE;
diff --git a/cc/layers/tiled_layer.cc b/cc/layers/tiled_layer.cc
index 7afb0d7..99b44ce 100644
--- a/cc/layers/tiled_layer.cc
+++ b/cc/layers/tiled_layer.cc
@@ -317,6 +317,7 @@ bool TiledLayer::UpdateTiles(int left,
int bottom,
ResourceUpdateQueue* queue,
const OcclusionTracker* occlusion,
+ RenderingStats* stats,
bool* did_paint) {
*did_paint = false;
CreateUpdaterIfNeeded();
@@ -338,7 +339,7 @@ bool TiledLayer::UpdateTiles(int left,
*did_paint = true;
UpdateTileTextures(
- paint_rect, left, top, right, bottom, queue, occlusion);
+ paint_rect, left, top, right, bottom, queue, occlusion, stats);
return true;
}
@@ -464,7 +465,8 @@ void TiledLayer::UpdateTileTextures(gfx::Rect paint_rect,
int right,
int bottom,
ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) {
// The update_rect should be in layer space. So we have to convert the
// paint_rect from content space to layer space.
float width_scale =
@@ -484,7 +486,8 @@ void TiledLayer::UpdateTileTextures(gfx::Rect paint_rect,
tiler_->tile_size(),
1.f / width_scale,
1.f / height_scale,
- &painted_opaque_rect);
+ &painted_opaque_rect,
+ stats);
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
@@ -549,7 +552,7 @@ void TiledLayer::UpdateTileTextures(gfx::Rect paint_rect,
CHECK_LE(paint_offset.y() + source_rect.height(), paint_rect.height());
tile->updater_resource()->Update(
- queue, source_rect, dest_offset, tile->partial_update);
+ queue, source_rect, dest_offset, tile->partial_update, stats);
if (occlusion) {
occlusion->overdraw_metrics()->
DidUpload(gfx::Transform(), source_rect, tile->opaque_rect());
@@ -716,13 +719,14 @@ void TiledLayer::UpdateScrollPrediction() {
}
void TiledLayer::Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) {
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) {
DCHECK(!skips_draw_ && !failed_update_); // Did ResetUpdateState get skipped?
{
base::AutoReset<bool> ignore_set_needs_commit(&ignore_set_needs_commit_,
true);
- ContentsScalingLayer::Update(queue, occlusion);
+ ContentsScalingLayer::Update(queue, occlusion, stats);
UpdateBounds();
}
@@ -741,7 +745,7 @@ void TiledLayer::Update(ResourceUpdateQueue* queue,
&top,
&right,
&bottom);
- UpdateTiles(left, top, right, bottom, queue, NULL, &did_paint);
+ UpdateTiles(left, top, right, bottom, queue, NULL, stats, &did_paint);
if (did_paint)
return;
// This was an attempt to paint the entire layer so if we fail it's okay,
@@ -759,7 +763,7 @@ void TiledLayer::Update(ResourceUpdateQueue* queue,
predicted_visible_rect_, &left, &top, &right, &bottom);
MarkOcclusionsAndRequestTextures(left, top, right, bottom, occlusion);
skips_draw_ = !UpdateTiles(
- left, top, right, bottom, queue, occlusion, &did_paint);
+ left, top, right, bottom, queue, occlusion, stats, &did_paint);
if (skips_draw_)
tiler_->reset();
if (skips_draw_ || did_paint)
@@ -772,7 +776,7 @@ void TiledLayer::Update(ResourceUpdateQueue* queue,
return;
// Prepaint anything that was occluded but inside the layer's visible region.
- if (!UpdateTiles(left, top, right, bottom, queue, NULL, &did_paint) ||
+ if (!UpdateTiles(left, top, right, bottom, queue, NULL, stats, &did_paint) ||
did_paint)
return;
@@ -802,7 +806,7 @@ void TiledLayer::Update(ResourceUpdateQueue* queue,
while (bottom < prepaint_bottom) {
++bottom;
if (!UpdateTiles(
- left, bottom, right, bottom, queue, NULL, &did_paint) ||
+ left, bottom, right, bottom, queue, NULL, stats, &did_paint) ||
did_paint)
return;
}
@@ -811,7 +815,7 @@ void TiledLayer::Update(ResourceUpdateQueue* queue,
while (top > prepaint_top) {
--top;
if (!UpdateTiles(
- left, top, right, top, queue, NULL, &did_paint) ||
+ left, top, right, top, queue, NULL, stats, &did_paint) ||
did_paint)
return;
}
@@ -820,7 +824,7 @@ void TiledLayer::Update(ResourceUpdateQueue* queue,
while (left > prepaint_left) {
--left;
if (!UpdateTiles(
- left, top, left, bottom, queue, NULL, &did_paint) ||
+ left, top, left, bottom, queue, NULL, stats, &did_paint) ||
did_paint)
return;
}
@@ -829,7 +833,7 @@ void TiledLayer::Update(ResourceUpdateQueue* queue,
while (right < prepaint_right) {
++right;
if (!UpdateTiles(
- right, top, right, bottom, queue, NULL, &did_paint) ||
+ right, top, right, bottom, queue, NULL, stats, &did_paint) ||
did_paint)
return;
}
diff --git a/cc/layers/tiled_layer.h b/cc/layers/tiled_layer.h
index a2d1ecb..e6112d0 100644
--- a/cc/layers/tiled_layer.h
+++ b/cc/layers/tiled_layer.h
@@ -34,7 +34,8 @@ class CC_EXPORT TiledLayer : public ContentsScalingLayer {
OVERRIDE;
virtual Region VisibleContentOpaqueRegion() const OVERRIDE;
virtual void Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats) OVERRIDE;
protected:
TiledLayer();
@@ -95,6 +96,7 @@ class CC_EXPORT TiledLayer : public ContentsScalingLayer {
int bottom,
ResourceUpdateQueue* queue,
const OcclusionTracker* occlusion,
+ RenderingStats* stats,
bool* did_paint);
bool HaveTexturesForTiles(int left,
int top,
@@ -112,7 +114,8 @@ class CC_EXPORT TiledLayer : public ContentsScalingLayer {
int right,
int bottom,
ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion);
+ const OcclusionTracker* occlusion,
+ RenderingStats* stats);
void UpdateScrollPrediction();
UpdatableTile* TileAt(int i, int j) const;
diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc
index 42b22b0..dd6c06e 100644
--- a/cc/layers/tiled_layer_unittest.cc
+++ b/cc/layers/tiled_layer_unittest.cc
@@ -17,7 +17,6 @@
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_proxy.h"
-#include "cc/test/fake_rendering_stats_instrumentation.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/tiled_layer_test_common.h"
#include "cc/trees/single_thread_proxy.h"
@@ -113,7 +112,7 @@ class TiledLayerTest : public testing::Test {
void LayerUpdate(FakeTiledLayer* layer, TestOcclusionTracker* occluded) {
DebugScopedSetMainThread main_thread(proxy_);
- layer->Update(queue_.get(), occluded);
+ layer->Update(queue_.get(), occluded, NULL);
}
void CalcDrawProps(const scoped_refptr<FakeTiledLayer>& layer1) {
@@ -162,9 +161,9 @@ class TiledLayerTest : public testing::Test {
// Update content
if (layer1)
- layer1->Update(queue_.get(), occlusion_);
+ layer1->Update(queue_.get(), occlusion_, NULL);
if (layer2)
- layer2->Update(queue_.get(), occlusion_);
+ layer2->Update(queue_.get(), occlusion_, NULL);
bool needs_update = false;
if (layer1)
@@ -606,7 +605,7 @@ TEST_F(TiledLayerTest, PaintSmallAnimatedLayersImmediately) {
// if it is close to the viewport size and has the available memory.
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
UpdateTextures();
LayerPushPropertiesTo(layer.get(), layer_impl.get());
@@ -773,7 +772,7 @@ TEST_F(TiledLayerTest, VerifyUpdateRectWhenContentBoundsAreScaled) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(0, 0, 300, 300 * 0.8), layer->update_rect());
UpdateTextures();
@@ -782,7 +781,7 @@ TEST_F(TiledLayerTest, VerifyUpdateRectWhenContentBoundsAreScaled) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
layer->InvalidateContentRect(content_bounds);
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(layer_bounds), layer->update_rect());
UpdateTextures();
@@ -792,7 +791,7 @@ TEST_F(TiledLayerTest, VerifyUpdateRectWhenContentBoundsAreScaled) {
layer->InvalidateContentRect(partial_damage);
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
EXPECT_FLOAT_RECT_EQ(gfx::RectF(45, 80, 15, 8), layer->update_rect());
}
@@ -812,7 +811,7 @@ TEST_F(TiledLayerTest, VerifyInvalidationWhenContentsScaleChanges) {
// Push the tiles to the impl side and check that there is exactly one.
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
UpdateTextures();
LayerPushPropertiesTo(layer.get(), layer_impl.get());
EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0));
@@ -830,7 +829,7 @@ TEST_F(TiledLayerTest, VerifyInvalidationWhenContentsScaleChanges) {
// The impl side should get 2x2 tiles now.
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
UpdateTextures();
LayerPushPropertiesTo(layer.get(), layer_impl.get());
EXPECT_TRUE(layer_impl->HasResourceIdForTileAt(0, 0));
@@ -911,7 +910,7 @@ TEST_F(TiledLayerTest, ResizeToSmaller) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
layer->SetBounds(gfx::Size(200, 200));
layer->InvalidateContentRect(gfx::Rect(0, 0, 200, 200));
@@ -929,7 +928,7 @@ TEST_F(TiledLayerTest, HugeLayerUpdateCrash) {
// Ensure no crash for bounds where size * size would overflow an int.
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
}
class TiledLayerPartialUpdateTest : public TiledLayerTest {
@@ -1060,7 +1059,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithoutOcclusion) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
EXPECT_EQ(2, layer->fake_layer_updater()->update_count());
}
@@ -1085,7 +1084,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusion) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count());
EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1);
@@ -1099,7 +1098,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusion) {
occluded.SetOcclusion(gfx::Rect(250, 200, 300, 100));
layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
EXPECT_EQ(36 - 2, layer->fake_layer_updater()->update_count());
EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1);
@@ -1114,7 +1113,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusion) {
occluded.SetOcclusion(gfx::Rect(250, 250, 300, 100));
layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
EXPECT_EQ(36, layer->fake_layer_updater()->update_count());
EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1);
@@ -1145,7 +1144,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndVisiblityConstraints) {
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
EXPECT_EQ(24 - 3, layer->fake_layer_updater()->update_count());
EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1);
@@ -1163,7 +1162,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndVisiblityConstraints) {
layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
EXPECT_EQ(24 - 6, layer->fake_layer_updater()->update_count());
EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1);
@@ -1182,7 +1181,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndVisiblityConstraints) {
layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
EXPECT_EQ(24 - 6, layer->fake_layer_updater()->update_count());
EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1);
@@ -1210,7 +1209,7 @@ TEST_F(TiledLayerTest, TilesNotPaintedWithoutInvalidation) {
layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count());
{ UpdateTextures(); }
@@ -1225,7 +1224,7 @@ TEST_F(TiledLayerTest, TilesNotPaintedWithoutInvalidation) {
// Repaint without marking it dirty. The 3 culled tiles will be pre-painted
// now.
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
EXPECT_EQ(3, layer->fake_layer_updater()->update_count());
EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1);
@@ -1260,7 +1259,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndTransforms) {
layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
EXPECT_EQ(36 - 3, layer->fake_layer_updater()->update_count());
EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1);
@@ -1299,7 +1298,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndScaling) {
layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
// The content is half the size of the layer (so the number of tiles is
// fewer). In this case, the content is 300x300, and since the tile size is
// 100, the number of tiles 3x3.
@@ -1323,7 +1322,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndScaling) {
layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
EXPECT_EQ(9 - 1, layer->fake_layer_updater()->update_count());
EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1);
@@ -1350,7 +1349,7 @@ TEST_F(TiledLayerTest, TilesPaintedWithOcclusionAndScaling) {
layer->InvalidateContentRect(gfx::Rect(0, 0, 600, 600));
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
EXPECT_EQ(9 - 1, layer->fake_layer_updater()->update_count());
EXPECT_NEAR(occluded.overdraw_metrics()->pixels_uploaded_opaque(), 0, 1);
@@ -1388,7 +1387,7 @@ TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) {
layer->InvalidateContentRect(content_bounds);
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
opaque_contents = layer->VisibleContentOpaqueRegion();
EXPECT_TRUE(opaque_contents.IsEmpty());
@@ -1405,7 +1404,7 @@ TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) {
layer->InvalidateContentRect(content_bounds);
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
UpdateTextures();
opaque_contents = layer->VisibleContentOpaqueRegion();
EXPECT_EQ(gfx::IntersectRects(opaque_paint_rect, visible_bounds).ToString(),
@@ -1422,7 +1421,7 @@ TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) {
layer->fake_layer_updater()->SetOpaquePaintRect(gfx::Rect());
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
UpdateTextures();
opaque_contents = layer->VisibleContentOpaqueRegion();
EXPECT_EQ(gfx::IntersectRects(opaque_paint_rect, visible_bounds).ToString(),
@@ -1441,7 +1440,7 @@ TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) {
layer->InvalidateContentRect(gfx::Rect(0, 0, 1, 1));
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
UpdateTextures();
opaque_contents = layer->VisibleContentOpaqueRegion();
EXPECT_EQ(gfx::IntersectRects(opaque_paint_rect, visible_bounds).ToString(),
@@ -1460,7 +1459,7 @@ TEST_F(TiledLayerTest, VisibleContentOpaqueRegion) {
layer->InvalidateContentRect(gfx::Rect(10, 10, 1, 1));
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
UpdateTextures();
opaque_contents = layer->VisibleContentOpaqueRegion();
EXPECT_EQ(gfx::IntersectRects(gfx::Rect(10, 100, 90, 100),
@@ -1499,7 +1498,7 @@ TEST_F(TiledLayerTest, Pixels_paintedMetrics) {
layer->InvalidateContentRect(content_bounds);
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
UpdateTextures();
opaque_contents = layer->VisibleContentOpaqueRegion();
EXPECT_TRUE(opaque_contents.IsEmpty());
@@ -1518,7 +1517,7 @@ TEST_F(TiledLayerTest, Pixels_paintedMetrics) {
layer->InvalidateContentRect(gfx::Rect(50, 200, 10, 10));
layer->SetTexturePriorities(priority_calculator_);
resource_manager_->PrioritizeTextures();
- layer->Update(queue_.get(), &occluded);
+ layer->Update(queue_.get(), &occluded, NULL);
UpdateTextures();
opaque_contents = layer->VisibleContentOpaqueRegion();
EXPECT_TRUE(opaque_contents.IsEmpty());
@@ -1720,8 +1719,7 @@ class UpdateTrackingTiledLayer : public FakeTiledLayer {
scoped_ptr<TrackingLayerPainter> painter(TrackingLayerPainter::Create());
tracking_layer_painter_ = painter.get();
layer_updater_ =
- BitmapContentLayerUpdater::Create(painter.PassAs<LayerPainter>(),
- &stats_instrumentation_);
+ BitmapContentLayerUpdater::Create(painter.PassAs<LayerPainter>());
}
TrackingLayerPainter* tracking_layer_painter() const {
@@ -1736,7 +1734,6 @@ class UpdateTrackingTiledLayer : public FakeTiledLayer {
TrackingLayerPainter* tracking_layer_painter_;
scoped_refptr<BitmapContentLayerUpdater> layer_updater_;
- FakeRenderingStatsInstrumentation stats_instrumentation_;
};
TEST_F(TiledLayerTest, NonIntegerContentsScaleIsNotDistortedDuringPaint) {
@@ -1757,7 +1754,7 @@ TEST_F(TiledLayerTest, NonIntegerContentsScaleIsNotDistortedDuringPaint) {
resource_manager_->PrioritizeTextures();
// Update the whole tile.
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
layer->tracking_layer_painter()->ResetPaintedRect();
EXPECT_RECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect());
@@ -1766,7 +1763,7 @@ TEST_F(TiledLayerTest, NonIntegerContentsScaleIsNotDistortedDuringPaint) {
// Invalidate the entire layer in content space. When painting, the rect given
// to webkit should match the layer's bounds.
layer->InvalidateContentRect(content_rect);
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
EXPECT_RECT_EQ(layer_rect, layer->tracking_layer_painter()->PaintedRect());
}
@@ -1789,7 +1786,7 @@ TEST_F(TiledLayerTest,
resource_manager_->PrioritizeTextures();
// Update the whole tile.
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
layer->tracking_layer_painter()->ResetPaintedRect();
EXPECT_RECT_EQ(gfx::Rect(), layer->tracking_layer_painter()->PaintedRect());
@@ -1798,7 +1795,7 @@ TEST_F(TiledLayerTest,
// Invalidate the entire layer in layer space. When painting, the rect given
// to webkit should match the layer's bounds.
layer->SetNeedsDisplayRect(layer_rect);
- layer->Update(queue_.get(), NULL);
+ layer->Update(queue_.get(), 0, NULL);
EXPECT_RECT_EQ(layer_rect, layer->tracking_layer_painter()->PaintedRect());
}