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

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

Issue 1334703002: NOT FOR LANDING Pass URL to Image::draw (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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) 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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 layerPaint.setXfermode(paint->getXfermode()); 1332 layerPaint.setXfermode(paint->getXfermode());
1333 layerPaint.setImageFilter(paint->getImageFilter()); 1333 layerPaint.setImageFilter(paint->getImageFilter());
1334 c->saveLayer(&filteredBounds, &layerPaint); 1334 c->saveLayer(&filteredBounds, &layerPaint);
1335 c->concat(ctm); 1335 c->concat(ctm);
1336 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); 1336 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode);
1337 imagePaint.setImageFilter(nullptr); 1337 imagePaint.setImageFilter(nullptr);
1338 } 1338 }
1339 1339
1340 if (!imageSource->isVideoElement()) { 1340 if (!imageSource->isVideoElement()) {
1341 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect)); 1341 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect));
1342 image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientatio n, Image::DoNotClampImageToSourceRect); 1342 image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientatio n, Image::DoNotClampImageToSourceRect, KURL()); // TODO(davve): empty url
1343 } else { 1343 } else {
1344 c->save(); 1344 c->save();
1345 c->clipRect(dstRect); 1345 c->clipRect(dstRect);
1346 c->translate(dstRect.x(), dstRect.y()); 1346 c->translate(dstRect.x(), dstRect.y());
1347 c->scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.h eight()); 1347 c->scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.h eight());
1348 c->translate(-srcRect.x(), -srcRect.y()); 1348 c->translate(-srcRect.x(), -srcRect.y());
1349 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(imageSource); 1349 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(imageSource);
1350 video->paintCurrentFrame(c, IntRect(IntPoint(), IntSize(video->videoWidt h(), video->videoHeight())), &imagePaint); 1350 video->paintCurrentFrame(c, IntRect(IntPoint(), IntSize(video->videoWidt h(), video->videoHeight())), &imagePaint);
1351 } 1351 }
1352 1352
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
2320 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) 2320 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage)
2321 return; 2321 return;
2322 if (alpha < 0xFF) 2322 if (alpha < 0xFF)
2323 return; 2323 return;
2324 } 2324 }
2325 2325
2326 canvas()->buffer()->willOverwriteCanvas(); 2326 canvas()->buffer()->willOverwriteCanvas();
2327 } 2327 }
2328 2328
2329 } // namespace blink 2329 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/svg/graphics/SVGImageForContainer.cpp ('k') | Source/modules/webgl/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698