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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "core/layout/LayoutBox.h" | 52 #include "core/layout/LayoutBox.h" |
53 #include "core/layout/LayoutTheme.h" | 53 #include "core/layout/LayoutTheme.h" |
54 #include "modules/canvas2d/CanvasGradient.h" | 54 #include "modules/canvas2d/CanvasGradient.h" |
55 #include "modules/canvas2d/CanvasPattern.h" | 55 #include "modules/canvas2d/CanvasPattern.h" |
56 #include "modules/canvas2d/CanvasRenderingContext2DState.h" | 56 #include "modules/canvas2d/CanvasRenderingContext2DState.h" |
57 #include "modules/canvas2d/CanvasStyle.h" | 57 #include "modules/canvas2d/CanvasStyle.h" |
58 #include "modules/canvas2d/HitRegion.h" | 58 #include "modules/canvas2d/HitRegion.h" |
59 #include "modules/canvas2d/Path2D.h" | 59 #include "modules/canvas2d/Path2D.h" |
60 #include "platform/fonts/FontCache.h" | 60 #include "platform/fonts/FontCache.h" |
61 #include "platform/geometry/FloatQuad.h" | 61 #include "platform/geometry/FloatQuad.h" |
| 62 #include "platform/graphics/BitmapImage.h" |
62 #include "platform/graphics/DrawLooperBuilder.h" | 63 #include "platform/graphics/DrawLooperBuilder.h" |
63 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" | 64 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" |
64 #include "platform/graphics/ImageBuffer.h" | 65 #include "platform/graphics/ImageBuffer.h" |
65 #include "platform/graphics/StrokeData.h" | 66 #include "platform/graphics/StrokeData.h" |
66 #include "platform/graphics/skia/SkiaUtils.h" | 67 #include "platform/graphics/skia/SkiaUtils.h" |
67 #include "platform/text/BidiTextRun.h" | 68 #include "platform/text/BidiTextRun.h" |
68 #include "public/platform/Platform.h" | 69 #include "public/platform/Platform.h" |
69 #include "third_party/skia/include/core/SkCanvas.h" | 70 #include "third_party/skia/include/core/SkCanvas.h" |
70 #include "third_party/skia/include/core/SkImageFilter.h" | 71 #include "third_party/skia/include/core/SkImageFilter.h" |
71 #include "wtf/ArrayBufferContents.h" | 72 #include "wtf/ArrayBufferContents.h" |
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 layerPaint.setXfermode(paint->getXfermode()); | 1328 layerPaint.setXfermode(paint->getXfermode()); |
1328 layerPaint.setImageFilter(paint->getImageFilter()); | 1329 layerPaint.setImageFilter(paint->getImageFilter()); |
1329 c->saveLayer(&filteredBounds, &layerPaint); | 1330 c->saveLayer(&filteredBounds, &layerPaint); |
1330 c->concat(ctm); | 1331 c->concat(ctm); |
1331 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); | 1332 imagePaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); |
1332 imagePaint.setImageFilter(nullptr); | 1333 imagePaint.setImageFilter(nullptr); |
1333 } | 1334 } |
1334 | 1335 |
1335 if (!imageSource->isVideoElement()) { | 1336 if (!imageSource->isVideoElement()) { |
1336 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect)); | 1337 imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect)); |
| 1338 if (image->isBitmapImage()) // FIXME |
| 1339 toBitmapImage(image)->setDrawingToCanvasElement(true); |
1337 image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientatio
n, Image::DoNotClampImageToSourceRect); | 1340 image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientatio
n, Image::DoNotClampImageToSourceRect); |
| 1341 if (image->isBitmapImage()) // FIXME |
| 1342 toBitmapImage(image)->setDrawingToCanvasElement(false); |
1338 } else { | 1343 } else { |
1339 c->save(); | 1344 c->save(); |
1340 c->clipRect(dstRect); | 1345 c->clipRect(dstRect); |
1341 c->translate(dstRect.x(), dstRect.y()); | 1346 c->translate(dstRect.x(), dstRect.y()); |
1342 c->scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.h
eight()); | 1347 c->scale(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.h
eight()); |
1343 c->translate(-srcRect.x(), -srcRect.y()); | 1348 c->translate(-srcRect.x(), -srcRect.y()); |
1344 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(imageSource); | 1349 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(imageSource); |
1345 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); |
1346 } | 1351 } |
1347 | 1352 |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2335 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) | 2340 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) |
2336 return; | 2341 return; |
2337 if (alpha < 0xFF) | 2342 if (alpha < 0xFF) |
2338 return; | 2343 return; |
2339 } | 2344 } |
2340 | 2345 |
2341 canvas()->buffer()->willOverwriteCanvas(); | 2346 canvas()->buffer()->willOverwriteCanvas(); |
2342 } | 2347 } |
2343 | 2348 |
2344 } // namespace blink | 2349 } // namespace blink |
OLD | NEW |