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

Unified Diff: Source/core/rendering/RenderVideo.cpp

Issue 594043005: Move paint code from RenderImage/RenderVideo into ImagePainter/VideoPainter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderVideo.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderVideo.cpp
diff --git a/Source/core/rendering/RenderVideo.cpp b/Source/core/rendering/RenderVideo.cpp
index ffee7ff48de6fe59c997748e8bde365e22ab502a..55ec0e3c1f465fb573765dcaa729f27f74b20927 100644
--- a/Source/core/rendering/RenderVideo.cpp
+++ b/Source/core/rendering/RenderVideo.cpp
@@ -32,6 +32,7 @@
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/html/HTMLVideoElement.h"
+#include "core/paint/VideoPainter.h"
#include "core/rendering/PaintInfo.h"
#include "core/rendering/RenderFullScreen.h"
#include "platform/graphics/media/MediaPlayer.h"
@@ -144,32 +145,7 @@ bool RenderVideo::shouldDisplayVideo() const
void RenderVideo::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- WebMediaPlayer* mediaPlayer = mediaElement()->webMediaPlayer();
- bool displayingPoster = videoElement()->shouldDisplayPosterImage();
- if (!displayingPoster && !mediaPlayer)
- return;
-
- LayoutRect rect = videoBox();
- if (rect.isEmpty())
- return;
- rect.moveBy(paintOffset);
-
- LayoutRect contentRect = contentBoxRect();
- contentRect.moveBy(paintOffset);
- GraphicsContext* context = paintInfo.context;
- bool clip = !contentRect.contains(rect);
- if (clip) {
- context->save();
- context->clip(contentRect);
- }
-
- if (displayingPoster)
- paintIntoRect(context, rect);
- else if ((document().view() && document().view()->paintBehavior() & PaintBehaviorFlattenCompositingLayers) || !acceleratedRenderingInUse())
- videoElement()->paintCurrentFrameInContext(context, pixelSnappedIntRect(rect));
-
- if (clip)
- context->restore();
+ VideoPainter(*this).paintReplaced(paintInfo, paintOffset);
}
bool RenderVideo::acceleratedRenderingInUse()
« no previous file with comments | « Source/core/rendering/RenderVideo.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698