Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
cc: Allow fully solid layers to contribute pixels for telemetry
Browse files Browse the repository at this point in the history
The theory is that some of the tests that check
mean_pixels_approximated could become worse after my change
because PLI's drawn as solid color were not adding its drawn
pixels into the calculation.  I can't replicate the test,
possibly due to lack of throttling on my phone, so the plan is
to commit this change and see if the tests go back to normal.

Even if it doesn't improve the test, the change is correct and
should be committed regardless.

BUG=416446

Review URL: https://codereview.chromium.org/607063003

Cr-Commit-Position: refs/heads/master@{#297087}
  • Loading branch information
hendrikw authored and Commit bot committed Sep 27, 2014
1 parent b1c6a6e commit 3c37dba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cc/layers/picture_layer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ void PictureLayerImpl::AppendQuads(
shared_quad_state,
content_bounds(),
draw_properties().target_space_transform,
pile_->solid_color());
pile_->solid_color(),
append_quads_data);
return;
}

Expand Down
10 changes: 8 additions & 2 deletions cc/layers/solid_color_layer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <algorithm>

#include "cc/layers/append_quads_data.h"
#include "cc/quads/solid_color_draw_quad.h"
#include "cc/trees/occlusion_tracker.h"

Expand All @@ -32,7 +33,8 @@ void SolidColorLayerImpl::AppendSolidQuads(
SharedQuadState* shared_quad_state,
const gfx::Size& content_bounds,
const gfx::Transform& target_space_transform,
SkColor color) {
SkColor color,
AppendQuadsData* append_quads_data) {
Occlusion occlusion =
occlusion_tracker.GetCurrentOcclusionForLayer(target_space_transform);

Expand All @@ -51,6 +53,9 @@ void SolidColorLayerImpl::AppendSolidQuads(
if (visible_quad_rect.IsEmpty())
continue;

append_quads_data->visible_content_area +=
visible_quad_rect.width() * visible_quad_rect.height();

SolidColorDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
quad->SetNew(
Expand All @@ -75,7 +80,8 @@ void SolidColorLayerImpl::AppendQuads(
shared_quad_state,
content_bounds(),
draw_properties().target_space_transform,
background_color());
background_color(),
append_quads_data);
}

const char* SolidColorLayerImpl::LayerTypeAsString() const {
Expand Down
3 changes: 2 additions & 1 deletion cc/layers/solid_color_layer_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class CC_EXPORT SolidColorLayerImpl : public LayerImpl {
SharedQuadState* shared_quad_state,
const gfx::Size& content_bounds,
const gfx::Transform& target_space_transform,
SkColor color);
SkColor color,
AppendQuadsData* append_quads_data);

virtual ~SolidColorLayerImpl();

Expand Down

0 comments on commit 3c37dba

Please sign in to comment.