Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 2657863004: Move scroll paint property nodes to be owned by the transform tree (Closed)
Patch Set: Rebase & remove parens Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 285
286 // Expand the tile to account for repeat spacing. 286 // Expand the tile to account for repeat spacing.
287 FloatRect spacedTile(tile); 287 FloatRect spacedTile(tile);
288 spacedTile.expand(FloatSize(repeatSpacing)); 288 spacedTile.expand(FloatSize(repeatSpacing));
289 289
290 SkPictureBuilder patternPicture(spacedTile, nullptr, &context); 290 SkPictureBuilder patternPicture(spacedTile, nullptr, &context);
291 // SVG images paint into their own property tree set that is distinct 291 // SVG images paint into their own property tree set that is distinct
292 // from the embedding frame tree. 292 // from the embedding frame tree.
293 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 293 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
294 PaintChunk::Id id(patternPicture, DisplayItem::kSVGImage); 294 PaintChunk::Id id(patternPicture, DisplayItem::kSVGImage);
295 PropertyTreeState state( 295 PropertyTreeState state(TransformPaintPropertyNode::root(),
296 TransformPaintPropertyNode::root(), ClipPaintPropertyNode::root(), 296 ClipPaintPropertyNode::root(),
297 EffectPaintPropertyNode::root(), ScrollPaintPropertyNode::root()); 297 EffectPaintPropertyNode::root());
298 m_paintController->updateCurrentPaintChunkProperties(&id, state); 298 m_paintController->updateCurrentPaintChunkProperties(&id, state);
299 } 299 }
300 300
301 { 301 {
302 DrawingRecorder patternPictureRecorder( 302 DrawingRecorder patternPictureRecorder(
303 patternPicture.context(), patternPicture, DisplayItem::Type::kSVGImage, 303 patternPicture.context(), patternPicture, DisplayItem::Type::kSVGImage,
304 spacedTile); 304 spacedTile);
305 // When generating an expanded tile, make sure we don't draw into the 305 // When generating an expanded tile, make sure we don't draw into the
306 // spacing area. 306 // spacing area.
307 if (tile != spacedTile) 307 if (tile != spacedTile)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // reset semantics (we'd paint the "last" frame rather than the one at 386 // reset semantics (we'd paint the "last" frame rather than the one at
387 // time=0.) The reason we do this here and not in resetAnimation() is to 387 // time=0.) The reason we do this here and not in resetAnimation() is to
388 // avoid setting timers from the latter. 388 // avoid setting timers from the latter.
389 flushPendingTimelineRewind(); 389 flushPendingTimelineRewind();
390 SkPictureBuilder imagePicture(dstRect, nullptr, nullptr, 390 SkPictureBuilder imagePicture(dstRect, nullptr, nullptr,
391 m_paintController.get()); 391 m_paintController.get());
392 // SVG images paint into their own property tree set that is distinct 392 // SVG images paint into their own property tree set that is distinct
393 // from the embedding frame tree. 393 // from the embedding frame tree.
394 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 394 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
395 PaintChunk::Id id(imagePicture, DisplayItem::kSVGImage); 395 PaintChunk::Id id(imagePicture, DisplayItem::kSVGImage);
396 PropertyTreeState state( 396 PropertyTreeState state(TransformPaintPropertyNode::root(),
397 TransformPaintPropertyNode::root(), ClipPaintPropertyNode::root(), 397 ClipPaintPropertyNode::root(),
398 EffectPaintPropertyNode::root(), ScrollPaintPropertyNode::root()); 398 EffectPaintPropertyNode::root());
399 m_paintController->updateCurrentPaintChunkProperties(&id, state); 399 m_paintController->updateCurrentPaintChunkProperties(&id, state);
400 } 400 }
401 401
402 { 402 {
403 ClipRecorder clipRecorder(imagePicture.context(), imagePicture, 403 ClipRecorder clipRecorder(imagePicture.context(), imagePicture,
404 DisplayItem::kClipNodeImage, 404 DisplayItem::kClipNodeImage,
405 enclosingIntRect(dstRect)); 405 enclosingIntRect(dstRect));
406 406
407 // We can only draw the entire frame, clipped to the rect we want. So 407 // We can only draw the entire frame, clipped to the rect we want. So
408 // compute where the top left of the image would be if we were drawing 408 // compute where the top left of the image would be if we were drawing
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 } 648 }
649 649
650 return m_page ? SizeAvailable : SizeUnavailable; 650 return m_page ? SizeAvailable : SizeUnavailable;
651 } 651 }
652 652
653 String SVGImage::filenameExtension() const { 653 String SVGImage::filenameExtension() const {
654 return "svg"; 654 return "svg";
655 } 655 }
656 656
657 } // namespace blink 657 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698