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

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

Issue 1489003002: Drop Image::setContainerSize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Back to ps#1 way, with fixed is_expensive test Created 5 years 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 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 [this, &dstRect](const SkIRect& clipBounds) // overdraw test lambda 1409 [this, &dstRect](const SkIRect& clipBounds) // overdraw test lambda
1410 { 1410 {
1411 return rectContainsTransformedRect(dstRect, clipBounds); 1411 return rectContainsTransformedRect(dstRect, clipBounds);
1412 }, dstRect, CanvasRenderingContext2DState::ImagePaintType, 1412 }, dstRect, CanvasRenderingContext2DState::ImagePaintType,
1413 imageSource->isOpaque() ? CanvasRenderingContext2DState::OpaqueImage : C anvasRenderingContext2DState::NonOpaqueImage); 1413 imageSource->isOpaque() ? CanvasRenderingContext2DState::OpaqueImage : C anvasRenderingContext2DState::NonOpaqueImage);
1414 1414
1415 validateStateStack(); 1415 validateStateStack();
1416 1416
1417 bool isExpensive = false; 1417 bool isExpensive = false;
1418 1418
1419 if (ExpensiveCanvasHeuristicParameters::SVGImageSourcesAreExpensive && image && image->isSVGImage()) 1419 if (ExpensiveCanvasHeuristicParameters::SVGImageSourcesAreExpensive && image Source->isSVGSource())
1420 isExpensive = true; 1420 isExpensive = true;
1421 1421
1422 if (imageSource->elementSize().width() * imageSource->elementSize().height() > canvas()->width() * canvas()->height() * ExpensiveCanvasHeuristicParameters:: ExpensiveImageSizeRatio) 1422 if (imageSource->elementSize().width() * imageSource->elementSize().height() > canvas()->width() * canvas()->height() * ExpensiveCanvasHeuristicParameters:: ExpensiveImageSizeRatio)
1423 isExpensive = true; 1423 isExpensive = true;
1424 1424
1425 if (isExpensive) { 1425 if (isExpensive) {
1426 ImageBuffer* buffer = canvas()->buffer(); 1426 ImageBuffer* buffer = canvas()->buffer();
1427 if (buffer) 1427 if (buffer)
1428 buffer->setHasExpensiveOp(); 1428 buffer->setHasExpensiveOp();
1429 } 1429 }
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
2335 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) 2335 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage)
2336 return; 2336 return;
2337 if (alpha < 0xFF) 2337 if (alpha < 0xFF)
2338 return; 2338 return;
2339 } 2339 }
2340 2340
2341 canvas()->buffer()->willOverwriteCanvas(); 2341 canvas()->buffer()->willOverwriteCanvas();
2342 } 2342 }
2343 2343
2344 } // namespace blink 2344 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698