summaryrefslogtreecommitdiff
path: root/chromium/cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-03-31 16:33:06 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-01 12:24:17 +0000
commitf65c42f8a6395a5fd85719adda57ada167b0dab6 (patch)
tree3840d098e781d092f46d2f2df84b7163d97c362f /chromium/cc
parentd26d06ed332166d6f61a5c06ab85aee5d987b2b6 (diff)
downloadqtwebengine-chromium-f65c42f8a6395a5fd85719adda57ada167b0dab6.tar.gz
BASELINE: Update Chromium to 49.0.2623.111
Change-Id: I5f8c7bd936a259c7229924aba755ae6064ac9240 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'chromium/cc')
-rw-r--r--chromium/cc/base/invalidation_region.h1
-rw-r--r--chromium/cc/blink/web_content_layer_impl.cc2
-rw-r--r--chromium/cc/debug/debug_rect_history.cc6
-rw-r--r--chromium/cc/debug/rasterize_and_record_benchmark.cc2
-rw-r--r--chromium/cc/layers/content_layer_client.h1
-rw-r--r--chromium/cc/layers/layer_impl.cc2
-rw-r--r--chromium/cc/layers/layer_impl.h2
-rw-r--r--chromium/cc/layers/picture_layer.cc26
-rw-r--r--chromium/cc/layers/picture_layer.h6
-rw-r--r--chromium/cc/layers/picture_layer_impl.cc2
-rw-r--r--chromium/cc/layers/picture_layer_impl.h2
-rw-r--r--chromium/cc/layers/picture_layer_impl_unittest.cc6
-rw-r--r--chromium/cc/layers/picture_layer_unittest.cc2
-rw-r--r--chromium/cc/playback/display_list_recording_source.cc14
-rw-r--r--chromium/cc/playback/display_list_recording_source.h5
-rw-r--r--chromium/cc/tiles/tiling_set_raster_queue_all.cc10
16 files changed, 52 insertions, 37 deletions
diff --git a/chromium/cc/base/invalidation_region.h b/chromium/cc/base/invalidation_region.h
index 3cf69f22140..7aa4a8b2a3b 100644
--- a/chromium/cc/base/invalidation_region.h
+++ b/chromium/cc/base/invalidation_region.h
@@ -23,7 +23,6 @@ class CC_EXPORT InvalidationRegion {
void Clear();
void Union(const gfx::Rect& rect);
bool IsEmpty() const { return region_.IsEmpty(); }
- Region* region() { return &region_; }
private:
void SimplifyIfNeeded();
diff --git a/chromium/cc/blink/web_content_layer_impl.cc b/chromium/cc/blink/web_content_layer_impl.cc
index 5e4e744f18b..458b3985738 100644
--- a/chromium/cc/blink/web_content_layer_impl.cc
+++ b/chromium/cc/blink/web_content_layer_impl.cc
@@ -34,6 +34,8 @@ PaintingControlToWeb(
switch (painting_control) {
case cc::ContentLayerClient::PAINTING_BEHAVIOR_NORMAL:
return blink::WebContentLayerClient::PaintDefaultBehavior;
+ case cc::ContentLayerClient::PAINTING_BEHAVIOR_NORMAL_FOR_TEST:
+ return blink::WebContentLayerClient::PaintDefaultBehaviorForTest;
case cc::ContentLayerClient::DISPLAY_LIST_CONSTRUCTION_DISABLED:
return blink::WebContentLayerClient::DisplayListConstructionDisabled;
case cc::ContentLayerClient::DISPLAY_LIST_CACHING_DISABLED:
diff --git a/chromium/cc/debug/debug_rect_history.cc b/chromium/cc/debug/debug_rect_history.cc
index 5ac2b5d8b55..f646fe984c2 100644
--- a/chromium/cc/debug/debug_rect_history.cc
+++ b/chromium/cc/debug/debug_rect_history.cc
@@ -67,10 +67,10 @@ void DebugRectHistory::SaveDebugRectsForCurrentFrame(
void DebugRectHistory::SavePaintRects(LayerImpl* layer) {
// We would like to visualize where any layer's paint rect (update rect) has
// changed, regardless of whether this layer is skipped for actual drawing or
- // not. Therefore we traverse recursively over all layers, not just the render
- // surface list.
+ // not. Therefore we traverse over all layers, not just the render surface
+ // list.
- Region invalidation_region = layer->GetInvalidationRegion();
+ Region invalidation_region = layer->GetInvalidationRegionForDebugging();
if (!invalidation_region.IsEmpty() && layer->DrawsContent()) {
for (Region::Iterator it(invalidation_region); it.has_rect(); it.next()) {
debug_rects_.push_back(DebugRect(
diff --git a/chromium/cc/debug/rasterize_and_record_benchmark.cc b/chromium/cc/debug/rasterize_and_record_benchmark.cc
index 59d166532de..3a49ab6648b 100644
--- a/chromium/cc/debug/rasterize_and_record_benchmark.cc
+++ b/chromium/cc/debug/rasterize_and_record_benchmark.cc
@@ -125,7 +125,7 @@ void RasterizeAndRecordBenchmark::RunOnLayer(PictureLayer* layer) {
mode_index < DisplayListRecordingSource::RECORDING_MODE_COUNT;
mode_index++) {
ContentLayerClient::PaintingControlSetting painting_control =
- ContentLayerClient::PAINTING_BEHAVIOR_NORMAL;
+ ContentLayerClient::PAINTING_BEHAVIOR_NORMAL_FOR_TEST;
switch (
static_cast<DisplayListRecordingSource::RecordingMode>(mode_index)) {
case DisplayListRecordingSource::RECORD_NORMALLY:
diff --git a/chromium/cc/layers/content_layer_client.h b/chromium/cc/layers/content_layer_client.h
index db9274fdb4e..75329c7c317 100644
--- a/chromium/cc/layers/content_layer_client.h
+++ b/chromium/cc/layers/content_layer_client.h
@@ -20,6 +20,7 @@ class CC_EXPORT ContentLayerClient {
public:
enum PaintingControlSetting {
PAINTING_BEHAVIOR_NORMAL,
+ PAINTING_BEHAVIOR_NORMAL_FOR_TEST,
DISPLAY_LIST_CONSTRUCTION_DISABLED,
DISPLAY_LIST_CACHING_DISABLED,
DISPLAY_LIST_PAINTING_DISABLED,
diff --git a/chromium/cc/layers/layer_impl.cc b/chromium/cc/layers/layer_impl.cc
index b845968c2f7..40bc9d59d51 100644
--- a/chromium/cc/layers/layer_impl.cc
+++ b/chromium/cc/layers/layer_impl.cc
@@ -1879,7 +1879,7 @@ void LayerImpl::SetForceRenderSurface(bool force_render_surface) {
NoteLayerPropertyChanged();
}
-Region LayerImpl::GetInvalidationRegion() {
+Region LayerImpl::GetInvalidationRegionForDebugging() {
return Region(update_rect_);
}
diff --git a/chromium/cc/layers/layer_impl.h b/chromium/cc/layers/layer_impl.h
index 4dca350d1dd..face8a609e7 100644
--- a/chromium/cc/layers/layer_impl.h
+++ b/chromium/cc/layers/layer_impl.h
@@ -651,7 +651,7 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
// Get the correct invalidation region instead of conservative Rect
// for layers that provide it.
- virtual Region GetInvalidationRegion();
+ virtual Region GetInvalidationRegionForDebugging();
virtual gfx::Rect GetEnclosingRectInTargetSpace() const;
diff --git a/chromium/cc/layers/picture_layer.cc b/chromium/cc/layers/picture_layer.cc
index f9df22cd9b8..fb890806fcd 100644
--- a/chromium/cc/layers/picture_layer.cc
+++ b/chromium/cc/layers/picture_layer.cc
@@ -65,9 +65,9 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
recording_source_->CreateRasterSource(can_use_lcd_text);
layer_impl->set_gpu_raster_max_texture_size(
layer_tree_host()->device_viewport_size());
- layer_impl->UpdateRasterSource(raster_source, invalidation_.region(),
+ layer_impl->UpdateRasterSource(raster_source, &last_updated_invalidation_,
nullptr);
- DCHECK(invalidation_.IsEmpty());
+ DCHECK(last_updated_invalidation_.IsEmpty());
}
void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) {
@@ -88,10 +88,8 @@ void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) {
void PictureLayer::SetNeedsDisplayRect(const gfx::Rect& layer_rect) {
DCHECK(!layer_tree_host() || !layer_tree_host()->in_paint_layer_contents());
- if (!layer_rect.IsEmpty()) {
- // Clamp invalidation to the layer bounds.
- invalidation_.Union(gfx::IntersectRects(layer_rect, gfx::Rect(bounds())));
- }
+ if (recording_source_)
+ recording_source_->SetNeedsDisplayRect(layer_rect);
Layer::SetNeedsDisplayRect(layer_rect);
}
@@ -102,12 +100,6 @@ bool PictureLayer::Update() {
gfx::Rect update_rect = visible_layer_rect();
gfx::Size layer_size = paint_properties().bounds;
- if (last_updated_visible_layer_rect_ == update_rect &&
- recording_source_->GetSize() == layer_size && invalidation_.IsEmpty()) {
- // Only early out if the visible content rect of this layer hasn't changed.
- return updated;
- }
-
recording_source_->SetBackgroundColor(SafeOpaqueBackgroundColor());
recording_source_->SetRequiresClear(!contents_opaque() &&
!client_->FillsBoundsCompletely());
@@ -124,7 +116,7 @@ bool PictureLayer::Update() {
// for them.
DCHECK(client_);
updated |= recording_source_->UpdateAndExpandInvalidation(
- client_, invalidation_.region(), layer_size, update_rect,
+ client_, &last_updated_invalidation_, layer_size, update_rect,
update_source_frame_number_, DisplayListRecordingSource::RECORD_NORMALLY);
last_updated_visible_layer_rect_ = visible_layer_rect();
@@ -133,7 +125,7 @@ bool PictureLayer::Update() {
} else {
// If this invalidation did not affect the recording source, then it can be
// cleared as an optimization.
- invalidation_.Clear();
+ last_updated_invalidation_.Clear();
}
return updated;
@@ -196,7 +188,7 @@ void PictureLayer::LayerSpecificPropertiesToProto(
proto::PictureLayerProperties* picture = proto->mutable_picture();
recording_source_->ToProtobuf(picture->mutable_recording_source());
- RegionToProto(*invalidation_.region(), picture->mutable_invalidation());
+ RegionToProto(last_updated_invalidation_, picture->mutable_invalidation());
RectToProto(last_updated_visible_layer_rect_,
picture->mutable_last_updated_visible_layer_rect());
picture->set_is_mask(is_mask_);
@@ -204,7 +196,7 @@ void PictureLayer::LayerSpecificPropertiesToProto(
picture->set_update_source_frame_number(update_source_frame_number_);
- invalidation_.Clear();
+ last_updated_invalidation_.Clear();
}
void PictureLayer::FromLayerSpecificPropertiesProto(
@@ -214,7 +206,7 @@ void PictureLayer::FromLayerSpecificPropertiesProto(
recording_source_->FromProtobuf(picture.recording_source());
Region new_invalidation = RegionFromProto(picture.invalidation());
- invalidation_.Swap(&new_invalidation);
+ last_updated_invalidation_.Swap(&new_invalidation);
last_updated_visible_layer_rect_ =
ProtoToRect(picture.last_updated_visible_layer_rect());
is_mask_ = picture.is_mask();
diff --git a/chromium/cc/layers/picture_layer.h b/chromium/cc/layers/picture_layer.h
index b7e71523802..6f71735ea75 100644
--- a/chromium/cc/layers/picture_layer.h
+++ b/chromium/cc/layers/picture_layer.h
@@ -70,10 +70,10 @@ class CC_EXPORT PictureLayer : public Layer {
devtools_instrumentation::
ScopedLayerObjectTracker instrumentation_object_tracker_;
- // Invalidation to use the next time update is called.
- InvalidationRegion invalidation_;
-
+ // These store the last visible layer and invalidation computed via a call
+ // to Update().
gfx::Rect last_updated_visible_layer_rect_;
+ Region last_updated_invalidation_;
int update_source_frame_number_;
bool is_mask_;
diff --git a/chromium/cc/layers/picture_layer_impl.cc b/chromium/cc/layers/picture_layer_impl.cc
index 0ec6ed79d43..124e5e7f1a3 100644
--- a/chromium/cc/layers/picture_layer_impl.cc
+++ b/chromium/cc/layers/picture_layer_impl.cc
@@ -648,7 +648,7 @@ skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() {
return raster_source_->GetFlattenedPicture();
}
-Region PictureLayerImpl::GetInvalidationRegion() {
+Region PictureLayerImpl::GetInvalidationRegionForDebugging() {
// |invalidation_| gives the invalidation contained in the source frame, but
// is not cleared after drawing from the layer. However, update_rect() is
// cleared once the invalidation is drawn, which is useful for debugging
diff --git a/chromium/cc/layers/picture_layer_impl.h b/chromium/cc/layers/picture_layer_impl.h
index 03316dcd011..4cd9a98b75f 100644
--- a/chromium/cc/layers/picture_layer_impl.h
+++ b/chromium/cc/layers/picture_layer_impl.h
@@ -53,7 +53,7 @@ class CC_EXPORT PictureLayerImpl
void ReleaseResources() override;
void RecreateResources() override;
skia::RefPtr<SkPicture> GetPicture() override;
- Region GetInvalidationRegion() override;
+ Region GetInvalidationRegionForDebugging() override;
// PictureLayerTilingClient overrides.
ScopedTilePtr CreateTile(const Tile::CreateInfo& info) override;
diff --git a/chromium/cc/layers/picture_layer_impl_unittest.cc b/chromium/cc/layers/picture_layer_impl_unittest.cc
index 9d1bbc90c54..5622cc33f65 100644
--- a/chromium/cc/layers/picture_layer_impl_unittest.cc
+++ b/chromium/cc/layers/picture_layer_impl_unittest.cc
@@ -4530,7 +4530,8 @@ TEST_F(PictureLayerImplTest, NonSolidToSolidNoTilings) {
client.set_fill_with_nonsolid_color(true);
- Region invalidation1(layer_rect);
+ recording_source->SetNeedsDisplayRect(layer_rect);
+ Region invalidation1;
recording_source->UpdateAndExpandInvalidation(
&client, &invalidation1, layer_bounds, layer_rect, frame_number++,
DisplayListRecordingSource::RECORD_NORMALLY);
@@ -4549,7 +4550,8 @@ TEST_F(PictureLayerImplTest, NonSolidToSolidNoTilings) {
client.set_fill_with_nonsolid_color(false);
- Region invalidation2(layer_rect);
+ recording_source->SetNeedsDisplayRect(layer_rect);
+ Region invalidation2;
recording_source->UpdateAndExpandInvalidation(
&client, &invalidation2, layer_bounds, layer_rect, frame_number++,
DisplayListRecordingSource::RECORD_NORMALLY);
diff --git a/chromium/cc/layers/picture_layer_unittest.cc b/chromium/cc/layers/picture_layer_unittest.cc
index 1ce756717bf..1baa811223e 100644
--- a/chromium/cc/layers/picture_layer_unittest.cc
+++ b/chromium/cc/layers/picture_layer_unittest.cc
@@ -46,7 +46,7 @@ class TestSerializationPictureLayer : public PictureLayer {
}
void set_invalidation(const Region& invalidation) {
- *invalidation_.region() = invalidation;
+ last_updated_invalidation_ = invalidation;
}
void set_last_updated_visible_layer_rect(const gfx::Rect& rect) {
diff --git a/chromium/cc/playback/display_list_recording_source.cc b/chromium/cc/playback/display_list_recording_source.cc
index d4e6a3e6e09..bfd8fdd29fe 100644
--- a/chromium/cc/playback/display_list_recording_source.cc
+++ b/chromium/cc/playback/display_list_recording_source.cc
@@ -111,6 +111,14 @@ void DisplayListRecordingSource::FinishDisplayItemListUpdate() {
display_list_->GenerateDiscardableImagesMetadata();
}
+void DisplayListRecordingSource::SetNeedsDisplayRect(
+ const gfx::Rect& layer_rect) {
+ if (!layer_rect.IsEmpty()) {
+ // Clamp invalidation to the layer bounds.
+ invalidation_.Union(gfx::IntersectRects(layer_rect, gfx::Rect(size_)));
+ }
+}
+
bool DisplayListRecordingSource::UpdateAndExpandInvalidation(
ContentLayerClient* painter,
Region* invalidation,
@@ -127,6 +135,9 @@ bool DisplayListRecordingSource::UpdateAndExpandInvalidation(
updated = true;
}
+ invalidation_.Swap(invalidation);
+ invalidation_.Clear();
+
gfx::Rect new_recorded_viewport = painter->PaintableRegion();
if (new_recorded_viewport != recorded_viewport_) {
UpdateInvalidationForNewViewport(recorded_viewport_, new_recorded_viewport,
@@ -144,6 +155,9 @@ bool DisplayListRecordingSource::UpdateAndExpandInvalidation(
if (!updated && !invalidation->Intersects(recorded_viewport_))
return false;
+ if (invalidation->IsEmpty())
+ return false;
+
ContentLayerClient::PaintingControlSetting painting_control =
ContentLayerClient::PAINTING_BEHAVIOR_NORMAL;
diff --git a/chromium/cc/playback/display_list_recording_source.h b/chromium/cc/playback/display_list_recording_source.h
index 4fb21648c4b..543a0409926 100644
--- a/chromium/cc/playback/display_list_recording_source.h
+++ b/chromium/cc/playback/display_list_recording_source.h
@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "cc/base/cc_export.h"
+#include "cc/base/invalidation_region.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
@@ -59,6 +60,8 @@ class CC_EXPORT DisplayListRecordingSource {
void SetBackgroundColor(SkColor background_color);
void SetRequiresClear(bool requires_clear);
+ void SetNeedsDisplayRect(const gfx::Rect& layer_rect);
+
// These functions are virtual for testing.
virtual scoped_refptr<DisplayListRasterSource> CreateRasterSource(
bool can_use_lcd_text) const;
@@ -92,6 +95,8 @@ class CC_EXPORT DisplayListRecordingSource {
void DetermineIfSolidColor();
+ InvalidationRegion invalidation_;
+
DISALLOW_COPY_AND_ASSIGN(DisplayListRecordingSource);
};
diff --git a/chromium/cc/tiles/tiling_set_raster_queue_all.cc b/chromium/cc/tiles/tiling_set_raster_queue_all.cc
index 1ed618a862b..ec5e4132773 100644
--- a/chromium/cc/tiles/tiling_set_raster_queue_all.cc
+++ b/chromium/cc/tiles/tiling_set_raster_queue_all.cc
@@ -35,10 +35,10 @@ TilingSetRasterQueueAll::TilingSetRasterQueueAll(
// Find high and low res tilings and initialize the iterators.
PictureLayerTiling* high_res_tiling = nullptr;
PictureLayerTiling* low_res_tiling = nullptr;
- // This variable would point to a tiling that has a NON_IDEAL_RESOLUTION
- // resolution on the active tree, but HIGH_RESOLUTION on the pending tree.
- // These tilings are the only non-ideal tilings that could have required for
- // activation tiles, so they need to be considered for rasterization.
+ // This variable would point to a tiling that has a NON_IDEAL_RESOLUTION or
+ // LOW_RESOLUTION on the active tree, but HIGH_RESOLUTION on the pending tree.
+ // These tilings are the only non-high res tilings that could have required
+ // for activation tiles, so they need to be considered for rasterization.
PictureLayerTiling* active_non_ideal_pending_high_res_tiling = nullptr;
for (size_t i = 0; i < tiling_set_->num_tilings(); ++i) {
PictureLayerTiling* tiling = tiling_set_->tiling_at(i);
@@ -46,7 +46,7 @@ TilingSetRasterQueueAll::TilingSetRasterQueueAll(
high_res_tiling = tiling;
if (prioritize_low_res && tiling->resolution() == LOW_RESOLUTION)
low_res_tiling = tiling;
- if (tree == ACTIVE_TREE && tiling->resolution() == NON_IDEAL_RESOLUTION) {
+ if (tree == ACTIVE_TREE && tiling->resolution() != HIGH_RESOLUTION) {
const PictureLayerTiling* twin =
client->GetPendingOrActiveTwinTiling(tiling);
if (twin && twin->resolution() == HIGH_RESOLUTION)