Update from https://crrev.com/312398
Involves adding many //testing/test.gni imports, fixing one
SkSurface::NewRenderTarget invocation inside sky, and fixing up
base::Process usage in the shell.
Review URL: https://codereview.chromium.org/862133002
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 281a3ae..d6e2a23 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -60,6 +60,7 @@
draw_checkerboard_for_missing_tiles_(false),
draws_content_(false),
hide_layer_and_subtree_(false),
+ clear_scroll_delta_at_activation_(false),
transform_is_invertible_(true),
is_container_for_fixed_position_layers_(false),
background_color_(0),
@@ -356,6 +357,10 @@
sent_scroll_delta_ = sent_scroll_delta;
}
+void LayerImpl::ClearScrollDeltaAtActivation() {
+ clear_scroll_delta_at_activation_ = true;
+}
+
gfx::Vector2dF LayerImpl::ScrollBy(const gfx::Vector2dF& scroll) {
gfx::Vector2dF adjusted_scroll = scroll;
if (layer_tree_impl()->settings().use_pinch_virtual_viewport) {
@@ -544,7 +549,11 @@
// Save the difference but clear the sent delta so that we don't subtract
// it again in SetScrollOffsetAndDelta's pending twin mirroring logic.
gfx::Vector2dF remaining_delta =
- layer->ScrollDelta() - layer->sent_scroll_delta();
+ clear_scroll_delta_at_activation_
+ ? gfx::Vector2dF()
+ : layer->ScrollDelta() - layer->sent_scroll_delta();
+ clear_scroll_delta_at_activation_ = false;
+
layer->SetSentScrollDelta(gfx::Vector2dF());
layer->SetScrollOffsetAndDelta(scroll_offset_, remaining_delta);
@@ -782,6 +791,9 @@
void LayerImpl::OnAnimationWaitingForDeletion() {}
+void LayerImpl::OnScrollOffsetAnimationRemoved() {
+}
+
bool LayerImpl::IsActive() const {
return layer_tree_impl_->IsActiveTree();
}
@@ -1162,6 +1174,8 @@
}
void LayerImpl::SetScrollDelta(const gfx::Vector2dF& scroll_delta) {
+ if (!IsActive() && clear_scroll_delta_at_activation_)
+ return;
SetScrollOffsetAndDelta(scroll_offset_, scroll_delta);
}
@@ -1452,35 +1466,24 @@
LayerTypeAsString(),
this);
state->SetInteger("layer_id", id());
- state->BeginDictionary("bounds");
- MathUtil::AddToTracedValue(bounds_, state);
- state->EndDictionary();
+ MathUtil::AddToTracedValue("bounds", bounds_, state);
state->SetDouble("opacity", opacity());
- state->BeginArray("position");
- MathUtil::AddToTracedValue(position_, state);
- state->EndArray();
+ MathUtil::AddToTracedValue("position", position_, state);
state->SetInteger("draws_content", DrawsContent());
state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes());
- state->BeginArray("scroll_offset");
- MathUtil::AddToTracedValue(scroll_offset_, state);
- state->EndArray();
-
- state->BeginArray("transform_origin");
- MathUtil::AddToTracedValue(transform_origin_, state);
- state->EndArray();
+ MathUtil::AddToTracedValue("scroll_offset", scroll_offset_, state);
+ MathUtil::AddToTracedValue("transform_origin", transform_origin_, state);
bool clipped;
gfx::QuadF layer_quad = MathUtil::MapQuad(
screen_space_transform(),
gfx::QuadF(gfx::Rect(content_bounds())),
&clipped);
- state->BeginArray("layer_quad");
- MathUtil::AddToTracedValue(layer_quad, state);
- state->EndArray();
+ MathUtil::AddToTracedValue("layer_quad", layer_quad, state);
if (!touch_event_handler_region_.IsEmpty()) {
state->BeginArray("touch_event_handler_region");
touch_event_handler_region_.AsValueInto(state);
@@ -1538,11 +1541,8 @@
layer_animation_controller()->HasAnimationThatInflatesBounds());
gfx::BoxF box;
- if (LayerUtils::GetAnimationBounds(*this, &box)) {
- state->BeginArray("animation_bounds");
- MathUtil::AddToTracedValue(box, state);
- state->EndArray();
- }
+ if (LayerUtils::GetAnimationBounds(*this, &box))
+ MathUtil::AddToTracedValue("animation_bounds", box, state);
if (debug_info_.get()) {
std::string str;