summaryrefslogtreecommitdiffstats
path: root/webkit/api/src/WebMediaPlayerClientImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/api/src/WebMediaPlayerClientImpl.cpp')
-rw-r--r--webkit/api/src/WebMediaPlayerClientImpl.cpp32
1 files changed, 5 insertions, 27 deletions
diff --git a/webkit/api/src/WebMediaPlayerClientImpl.cpp b/webkit/api/src/WebMediaPlayerClientImpl.cpp
index e9d5220..400fa7e 100644
--- a/webkit/api/src/WebMediaPlayerClientImpl.cpp
+++ b/webkit/api/src/WebMediaPlayerClientImpl.cpp
@@ -27,9 +27,12 @@
#include "KURL.h"
#include "MediaPlayer.h"
#include "NotImplemented.h"
-#include "PlatformContextSkia.h"
#include <wtf/Assertions.h>
+#if WEBKIT_USING_SKIA
+#include "PlatformContextSkia.h"
+#endif
+
using namespace WebCore;
namespace WebKit {
@@ -331,32 +334,7 @@ void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& re
#if WEBKIT_USING_SKIA
m_webMediaPlayer->paint(context->platformContext()->canvas(), rect);
#elif WEBKIT_USING_CG
- // If there is no preexisting platform canvas, or if the size has
- // changed, recreate the canvas. This is to avoid recreating the bitmap
- // buffer over and over for each frame of video.
- if (!m_webCanvas ||
- m_webCanvas->getDevice()->width() != rect.width() ||
- m_webCanvas->getDevice()->height() != rect.height()) {
- m_webCanvas.set(new WebCanvas(rect.width(), rect.height(), true));
- }
-
- IntRect normalized_rect(0, 0, rect.width(), rect.height());
- m_webMediaPlayer->paint(m_webCanvas.get(), normalized_rect);
-
- // The mac coordinate system is flipped vertical from the normal skia
- // coordinates. During painting of the frame, flip the coordinates
- // system and, for simplicity, also translate the clip rectangle to
- // start at 0,0.
- CGContext* cgContext = context->platformContext();
- CGContextSaveGState(cgContext);
- CGContextTranslateCTM(cgContext, rect.x(), rect.height() + rect.y());
- CGContextScaleCTM(cgContext, 1.0, -1.0);
- CGRect normalized_cgrect = normalized_rect; // For DrawToContext.
-
- m_webCanvas->getTopPlatformDevice().DrawToContext(
- context->platformContext(), 0, 0, &normalized_cgrect);
-
- CGContextRestoreGState(cgContext);
+ m_webMediaPlayer->paint(context->platformContext(), rect);
#else
notImplemented();
#endif