Commit 9a1b4b7f authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[SPv175+] Use SkMatrix in CompositedLayerRasterInvalidator::PaintChunkInfo

Transforms within a layer should be all 2D.
This reduces sizeof(PaintChunInfo) by 88 bytes.

Also adjust order of fields to avoid gaps.

painter_memory_usage reduce by 25% combined with
https://chromium-review.googlesource.com/c/chromium/src/+/1011146:
https://ct.skia.org/results/cluster-telemetry/tasks/chromium_perf_runs/wangxianzhu-20180413042756/html/index.html

Bug: 824415
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I5e6a3526b077d5306ab0776782e467c98ba1d91f
Reviewed-on: https://chromium-review.googlesource.com/1011826Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Reviewed-by: default avatarTien-Ren Chen <trchen@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550841}
parent 4beb478f
...@@ -55,24 +55,25 @@ class PLATFORM_EXPORT CompositedLayerRasterInvalidator { ...@@ -55,24 +55,25 @@ class PLATFORM_EXPORT CompositedLayerRasterInvalidator {
PaintChunkInfo(const CompositedLayerRasterInvalidator& invalidator, PaintChunkInfo(const CompositedLayerRasterInvalidator& invalidator,
const ChunkToLayerMapper& mapper, const ChunkToLayerMapper& mapper,
const PaintChunk& chunk) const PaintChunk& chunk)
: bounds_in_layer(invalidator.ClipByLayerBounds( : id(chunk.id),
properties(chunk.properties),
is_cacheable(chunk.is_cacheable),
bounds_in_layer(invalidator.ClipByLayerBounds(
mapper.MapVisualRect(chunk.bounds))), mapper.MapVisualRect(chunk.bounds))),
chunk_to_layer_transform(mapper.Transform()),
chunk_to_layer_clip(mapper.ClipRect()), chunk_to_layer_clip(mapper.ClipRect()),
id(chunk.id), chunk_to_layer_transform(
is_cacheable(chunk.is_cacheable), TransformationMatrix::ToSkMatrix44(mapper.Transform())) {}
properties(chunk.properties) {}
bool Matches(const PaintChunk& new_chunk) const { bool Matches(const PaintChunk& new_chunk) const {
return is_cacheable && new_chunk.Matches(id); return is_cacheable && new_chunk.Matches(id);
} }
IntRect bounds_in_layer;
TransformationMatrix chunk_to_layer_transform;
FloatClipRect chunk_to_layer_clip;
PaintChunk::Id id; PaintChunk::Id id;
bool is_cacheable;
PaintChunkProperties properties; PaintChunkProperties properties;
bool is_cacheable;
IntRect bounds_in_layer;
FloatClipRect chunk_to_layer_clip;
SkMatrix chunk_to_layer_transform;
}; };
void GenerateRasterInvalidations(const PaintChunkSubset& new_chunks, void GenerateRasterInvalidations(const PaintChunkSubset& new_chunks,
......
...@@ -137,10 +137,9 @@ class ConversionContext { ...@@ -137,10 +137,9 @@ class ConversionContext {
SkMatrix GetSkMatrix( SkMatrix GetSkMatrix(
const TransformPaintPropertyNode* target_transform) const { const TransformPaintPropertyNode* target_transform) const {
return AffineTransformToSkMatrix( return SkMatrix(TransformationMatrix::ToSkMatrix44(
GeometryMapper::SourceToDestinationProjection(target_transform, GeometryMapper::SourceToDestinationProjection(target_transform,
current_transform_) current_transform_)));
.ToAffineTransform());
} }
void AppendRestore(size_t n) { void AppendRestore(size_t n) {
......
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