Commit 3c37dba2 authored by hendrikw's avatar hendrikw Committed by Commit bot

cc: Allow fully solid layers to contribute pixels for telemetry

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}
parent b1c6a6e8
......@@ -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;
}
......
......@@ -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"
......@@ -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);
......@@ -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(
......@@ -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 {
......
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment