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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 1438663002: Avoid calling imageForCurrentFrame on SVGImage when not necessary (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
10 * 10 *
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 FloatRect srcRect = normalizeRect(FloatRect(sx, sy, sw, sh)); 1387 FloatRect srcRect = normalizeRect(FloatRect(sx, sy, sw, sh));
1388 FloatRect dstRect = normalizeRect(FloatRect(dx, dy, dw, dh)); 1388 FloatRect dstRect = normalizeRect(FloatRect(dx, dy, dw, dh));
1389 1389
1390 clipRectsToImageRect(FloatRect(FloatPoint(), imageSource->elementSize()), &s rcRect, &dstRect); 1390 clipRectsToImageRect(FloatRect(FloatPoint(), imageSource->elementSize()), &s rcRect, &dstRect);
1391 1391
1392 imageSource->adjustDrawRects(&srcRect, &dstRect); 1392 imageSource->adjustDrawRects(&srcRect, &dstRect);
1393 1393
1394 if (srcRect.isEmpty()) 1394 if (srcRect.isEmpty())
1395 return; 1395 return;
1396 1396
1397 if (shouldDisableDeferral(imageSource) || image->imageForCurrentFrame()->isT extureBacked()) 1397 if (shouldDisableDeferral(imageSource) || image->isTextureBacked())
1398 canvas()->disableDeferral(); 1398 canvas()->disableDeferral();
1399 1399
1400 validateStateStack(); 1400 validateStateStack();
1401 1401
1402 draw( 1402 draw(
1403 [this, &imageSource, &image, &srcRect, dstRect](SkCanvas* c, const SkPai nt* paint) // draw lambda 1403 [this, &imageSource, &image, &srcRect, dstRect](SkCanvas* c, const SkPai nt* paint) // draw lambda
1404 { 1404 {
1405 drawImageInternal(c, imageSource, image.get(), srcRect, dstRect, pai nt); 1405 drawImageInternal(c, imageSource, image.get(), srcRect, dstRect, pai nt);
1406 }, 1406 },
1407 [this, &dstRect](const SkIRect& clipBounds) // overdraw test lambda 1407 [this, &dstRect](const SkIRect& clipBounds) // overdraw test lambda
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
2333 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) 2333 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage)
2334 return; 2334 return;
2335 if (alpha < 0xFF) 2335 if (alpha < 0xFF)
2336 return; 2336 return;
2337 } 2337 }
2338 2338
2339 canvas()->buffer()->willOverwriteCanvas(); 2339 canvas()->buffer()->willOverwriteCanvas();
2340 } 2340 }
2341 2341
2342 } // namespace blink 2342 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698