| OLD | NEW |
| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "core/layout/LayoutBox.h" | 51 #include "core/layout/LayoutBox.h" |
| 52 #include "core/layout/LayoutTheme.h" | 52 #include "core/layout/LayoutTheme.h" |
| 53 #include "modules/canvas2d/CanvasGradient.h" | 53 #include "modules/canvas2d/CanvasGradient.h" |
| 54 #include "modules/canvas2d/CanvasPattern.h" | 54 #include "modules/canvas2d/CanvasPattern.h" |
| 55 #include "modules/canvas2d/CanvasRenderingContext2DState.h" | 55 #include "modules/canvas2d/CanvasRenderingContext2DState.h" |
| 56 #include "modules/canvas2d/CanvasStyle.h" | 56 #include "modules/canvas2d/CanvasStyle.h" |
| 57 #include "modules/canvas2d/HitRegion.h" | 57 #include "modules/canvas2d/HitRegion.h" |
| 58 #include "modules/canvas2d/Path2D.h" | 58 #include "modules/canvas2d/Path2D.h" |
| 59 #include "platform/fonts/FontCache.h" | 59 #include "platform/fonts/FontCache.h" |
| 60 #include "platform/geometry/FloatQuad.h" | 60 #include "platform/geometry/FloatQuad.h" |
| 61 #include "platform/graphics/BitmapImage.h" |
| 61 #include "platform/graphics/DrawLooperBuilder.h" | 62 #include "platform/graphics/DrawLooperBuilder.h" |
| 62 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" | 63 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" |
| 63 #include "platform/graphics/ImageBuffer.h" | 64 #include "platform/graphics/ImageBuffer.h" |
| 64 #include "platform/graphics/StrokeData.h" | 65 #include "platform/graphics/StrokeData.h" |
| 65 #include "platform/graphics/skia/SkiaUtils.h" | 66 #include "platform/graphics/skia/SkiaUtils.h" |
| 66 #include "platform/text/BidiTextRun.h" | 67 #include "platform/text/BidiTextRun.h" |
| 67 #include "public/platform/Platform.h" | 68 #include "public/platform/Platform.h" |
| 68 #include "third_party/skia/include/core/SkCanvas.h" | 69 #include "third_party/skia/include/core/SkCanvas.h" |
| 69 #include "third_party/skia/include/core/SkImageFilter.h" | 70 #include "third_party/skia/include/core/SkImageFilter.h" |
| 70 #include "wtf/ArrayBufferContents.h" | 71 #include "wtf/ArrayBufferContents.h" |
| (...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 layerPaint.setXfermode(paint->getXfermode()); | 1321 layerPaint.setXfermode(paint->getXfermode()); |
| 1321 SkAutoTUnref<SkImageFilter> localFilter(paint->getImageFilter()->newWith
LocalMatrix(invCtm)); | 1322 SkAutoTUnref<SkImageFilter> localFilter(paint->getImageFilter()->newWith
LocalMatrix(invCtm)); |
| 1322 layerPaint.setImageFilter(localFilter); | 1323 layerPaint.setImageFilter(localFilter); |
| 1323 c->saveLayer(&bounds, &layerPaint); | 1324 c->saveLayer(&bounds, &layerPaint); |
| 1324 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); | 1325 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); |
| 1325 imagePaint.setImageFilter(nullptr); | 1326 imagePaint.setImageFilter(nullptr); |
| 1326 } | 1327 } |
| 1327 | 1328 |
| 1328 if (!imageSource->isVideoElement()) { | 1329 if (!imageSource->isVideoElement()) { |
| 1329 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect)); | 1330 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect)); |
| 1331 if (image->isBitmapImage()) // FIXME: remove. |
| 1332 toBitmapImage(image)->setDrawingToCanvasElement(true); |
| 1330 image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientatio
n, Image::DoNotClampImageToSourceRect); | 1333 image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientatio
n, Image::DoNotClampImageToSourceRect); |
| 1334 if (image->isBitmapImage()) // FIXME: remove. |
| 1335 toBitmapImage(image)->setDrawingToCanvasElement(false); |
| 1331 } else { | 1336 } else { |
| 1332 c->save(); | 1337 c->save(); |
| 1333 c->clipRect(dstRect); | 1338 c->clipRect(dstRect); |
| 1334 c->translate(dstRect.x(), dstRect.y()); | 1339 c->translate(dstRect.x(), dstRect.y()); |
| 1335 c->scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.h
eight()); | 1340 c->scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.h
eight()); |
| 1336 c->translate(-srcRect.x(), -srcRect.y()); | 1341 c->translate(-srcRect.x(), -srcRect.y()); |
| 1337 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(imageSource); | 1342 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(imageSource); |
| 1338 video->paintCurrentFrame(c, IntRect(IntPoint(), IntSize(video->videoWidt
h(), video->videoHeight())), &imagePaint); | 1343 video->paintCurrentFrame(c, IntRect(IntPoint(), IntSize(video->videoWidt
h(), video->videoHeight())), &imagePaint); |
| 1339 } | 1344 } |
| 1340 | 1345 |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2328 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) | 2333 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) |
| 2329 return; | 2334 return; |
| 2330 if (alpha < 0xFF) | 2335 if (alpha < 0xFF) |
| 2331 return; | 2336 return; |
| 2332 } | 2337 } |
| 2333 | 2338 |
| 2334 canvas()->buffer()->willOverwriteCanvas(); | 2339 canvas()->buffer()->willOverwriteCanvas(); |
| 2335 } | 2340 } |
| 2336 | 2341 |
| 2337 } // namespace blink | 2342 } // namespace blink |
| OLD | NEW |