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

Unified Diff: third_party/WebKit/Source/core/paint/VideoPainter.cpp

Issue 2134253002: Adjust src and dest rects when drawing images instead of using a clip (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dcheck for containment Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/ImagePainter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/VideoPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/VideoPainter.cpp b/third_party/WebKit/Source/core/paint/VideoPainter.cpp
index 49ea54a6bbfed97026e035d2de081d3d9ca54d78..07b42bda4689a75e8cd1ef529283e47b6f14ffe2 100644
--- a/third_party/WebKit/Source/core/paint/VideoPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/VideoPainter.cpp
@@ -12,7 +12,6 @@
#include "core/paint/LayoutObjectDrawingRecorder.h"
#include "core/paint/PaintInfo.h"
#include "platform/geometry/LayoutPoint.h"
-#include "platform/graphics/paint/ClipRecorder.h"
#include "platform/graphics/paint/ForeignLayerDisplayItem.h"
namespace blink {
@@ -29,18 +28,13 @@ void VideoPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint&
return;
rect.moveBy(paintOffset);
+ if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.context, m_layoutVideo, paintInfo.phase))
+ return;
+
GraphicsContext& context = paintInfo.context;
LayoutRect contentRect = m_layoutVideo.contentBoxRect();
contentRect.moveBy(paintOffset);
- Optional<ClipRecorder> clipRecorder;
- if (!contentRect.contains(rect))
- clipRecorder.emplace(context, m_layoutVideo, paintInfo.displayItemTypeForClipping(), pixelSnappedIntRect(contentRect));
-
- if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, m_layoutVideo, paintInfo.phase))
- return;
-
-
// Video frames are only painted in software for printing or capturing node images via web APIs.
bool forceSoftwareVideoPaint = paintInfo.getGlobalPaintFlags() & GlobalPaintFlattenCompositingLayers;
@@ -61,7 +55,7 @@ void VideoPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint&
if (displayingPoster || !forceSoftwareVideoPaint) {
// This will display the poster image, if one is present, and otherwise paint nothing.
- ImagePainter(m_layoutVideo).paintIntoRect(context, rect);
+ ImagePainter(m_layoutVideo).paintIntoRect(context, rect, contentRect);
} else {
SkPaint videoPaint = context.fillPaint();
videoPaint.setColor(SK_ColorBLACK);
« no previous file with comments | « third_party/WebKit/Source/core/paint/ImagePainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698