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

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

Issue 1909033003: Add FrameView::updateAllLifecyclePhasesExceptPaint and use it in a few cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 356
357 // We can only draw the entire frame, clipped to the rect we want. So co mpute where the top left 357 // We can only draw the entire frame, clipped to the rect we want. So co mpute where the top left
358 // of the image would be if we were drawing without clipping, and transl ate accordingly. 358 // of the image would be if we were drawing without clipping, and transl ate accordingly.
359 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr cRect.height()); 359 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr cRect.height());
360 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect. location().y() * scale.height()); 360 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect. location().y() * scale.height());
361 FloatPoint destOffset = dstRect.location() - topLeftOffset; 361 FloatPoint destOffset = dstRect.location() - topLeftOffset;
362 AffineTransform transform = AffineTransform::translation(destOffset.x(), destOffset.y()); 362 AffineTransform transform = AffineTransform::translation(destOffset.x(), destOffset.y());
363 transform.scale(scale.width(), scale.height()); 363 transform.scale(scale.width(), scale.height());
364 TransformRecorder transformRecorder(imagePicture.context(), *this, trans form); 364 TransformRecorder transformRecorder(imagePicture.context(), *this, trans form);
365 365
366 // TODO(crbug.com/603230): Synchronized painting is unnecessary in this lifecycle update. 366 view->updateAllLifecyclePhasesExceptPaint();
367 view->updateAllLifecyclePhases();
368 view->paint(imagePicture.context(), CullRect(enclosingIntRect(srcRect))) ; 367 view->paint(imagePicture.context(), CullRect(enclosingIntRect(srcRect))) ;
369 ASSERT(!view->needsLayout()); 368 ASSERT(!view->needsLayout());
370 } 369 }
371 370
372 { 371 {
373 SkAutoCanvasRestore ar(canvas, false); 372 SkAutoCanvasRestore ar(canvas, false);
374 if (drawNeedsLayer(paint)) { 373 if (drawNeedsLayer(paint)) {
375 SkRect layerRect = dstRect; 374 SkRect layerRect = dstRect;
376 canvas->saveLayer(&layerRect, &paint); 375 canvas->saveLayer(&layerRect, &paint);
377 } 376 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 541
543 return m_page; 542 return m_page;
544 } 543 }
545 544
546 String SVGImage::filenameExtension() const 545 String SVGImage::filenameExtension() const
547 { 546 {
548 return "svg"; 547 return "svg";
549 } 548 }
550 549
551 } // namespace blink 550 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698