[BlackBerry] Remove skia code from PluginViewBlackBerry
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Apr 2013 18:22:17 +0000 (18:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Apr 2013 18:22:17 +0000 (18:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=113936

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-04-04
Reviewed by Rob Buis.

Skia is not used anymore by the BlackBerry port.

* plugins/blackberry/PluginViewBlackBerry.cpp:
(WebCore::PluginView::paint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147654 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp

index f4a7857..bb784e6 100644 (file)
@@ -1,3 +1,15 @@
+2013-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [BlackBerry] Remove skia code from PluginViewBlackBerry
+        https://bugs.webkit.org/show_bug.cgi?id=113936
+
+        Reviewed by Rob Buis.
+
+        Skia is not used anymore by the BlackBerry port.
+
+        * plugins/blackberry/PluginViewBlackBerry.cpp:
+        (WebCore::PluginView::paint):
+
 2013-04-04  Emil A Eklund  <eae@chromium.org>
 
         Change RenderFrameSet::computeEdgeInfo to use m-rows/m_cols directly
index 937d966..76784f8 100644 (file)
@@ -43,7 +43,6 @@
 #include "NPCallbacksBlackBerry.h"
 #include "NotImplemented.h"
 #include "Page.h"
-#include "PlatformContextSkia.h"
 #include "PlatformKeyboardEvent.h"
 #include "PluginDebug.h"
 #include "PluginMainThreadScheduler.h"
@@ -246,146 +245,6 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
     exposedRect.move(-frameRect().x(), -frameRect().y());
 
     updateBuffer(exposedRect);
-
-    PthreadReadLocker frontLock(&m_private->m_frontBufferRwLock);
-
-    BlackBerry::Platform::Graphics::Buffer* frontBuffer =
-        m_private->m_pluginBuffers[m_private->m_pluginFrontBuffer];
-
-    // Don't paint anything if there is no buffer.
-    if (!frontBuffer)
-        return;
-
-    const BlackBerry::Platform::Graphics::BackingImage* backingImage =
-        BlackBerry::Platform::Graphics::lockBufferBackingImage(frontBuffer,
-                                                            BlackBerry::Platform::Graphics::ReadAccess);
-    if (!backingImage)
-        return;
-
-    // Draw the changed buffer contents to the screen.
-    context->save();
-
-    const SkBitmap& pluginImage = *backingImage;
-    PlatformGraphicsContext* graphics = context->platformContext();
-    ASSERT(graphics);
-    SkCanvas* canvas = graphics->canvas();
-
-    // Source rectangle we will draw to the screen.
-    SkIRect skSrcRect;
-    skSrcRect.set(exposedRect.x(), exposedRect.y(),
-                  exposedRect.x() + exposedRect.width(),
-                  exposedRect.y() + exposedRect.height());
-
-    // Prepare the hole punch rectangle.
-    SkIRect unclippedHolePunchRect;
-    unclippedHolePunchRect.set(m_private->m_holePunchRect.x(),
-                               m_private->m_holePunchRect.y(),
-                               m_private->m_holePunchRect.x() + m_private->m_holePunchRect.width(),
-                               m_private->m_holePunchRect.y() + m_private->m_holePunchRect.height());
-
-    // holePunchRect is clipped.
-    SkIRect holePunchRect;
-
-    // All source rectangles are scaled by the zoom factor because the source bitmap may be a
-    // higher resolution than the 1:1 page. This allows the flash player to scale the content
-    // it is drawing to match the scale of the page.
-    double zoomFactorH = static_cast<double>(m_private->m_pluginBufferSize.width()) / static_cast<double>(frameRect().width());
-    double zoomFactorW = static_cast<double>(m_private->m_pluginBufferSize.height()) / static_cast<double>(frameRect().height());
-    double zoomFactor = (zoomFactorH + zoomFactorW) / 2.0;
-
-    // This method draws a hole if specified.
-    if (!m_private->m_holePunchRect.isEmpty()
-        && holePunchRect.intersect(unclippedHolePunchRect, skSrcRect)) {
-
-        // Draw the top chunk if needed.
-        if (holePunchRect.fTop > skSrcRect.fTop) {
-            SkIRect srcRect;
-            srcRect.set(skSrcRect.fLeft * zoomFactor, skSrcRect.fTop * zoomFactor,
-                        skSrcRect.fRight * zoomFactor, holePunchRect.fTop * zoomFactor);
-
-            SkRect dstRect;
-            dstRect.set(skSrcRect.fLeft, skSrcRect.fTop,
-                        skSrcRect.fRight, holePunchRect.fTop);
-            dstRect.offset(frameRect().x(), frameRect().y());
-
-            canvas->drawBitmapRect(pluginImage, &srcRect, dstRect);
-        }
-
-        // Draw the left chunk if needed.
-        if (holePunchRect.fLeft > skSrcRect.fLeft) {
-            SkIRect srcRect;
-            srcRect.set(skSrcRect.fLeft * zoomFactor, holePunchRect.fTop * zoomFactor,
-                        holePunchRect.fLeft * zoomFactor, holePunchRect.fBottom * zoomFactor);
-
-            SkRect dstRect;
-            dstRect.set(skSrcRect.fLeft, holePunchRect.fTop,
-                        holePunchRect.fLeft, holePunchRect.fBottom);
-            dstRect.offset(frameRect().x(), frameRect().y());
-
-            canvas->drawBitmapRect(pluginImage, &srcRect, dstRect);
-        }
-
-        // Draw the hole chunk.
-        {
-            SkPaint paint;
-            paint.setXfermodeMode(SkXfermode::kSrc_Mode);
-
-            SkIRect srcRect;
-            srcRect.set(holePunchRect.fLeft * zoomFactor, holePunchRect.fTop * zoomFactor,
-                        holePunchRect.fRight * zoomFactor, holePunchRect.fBottom * zoomFactor);
-
-            SkRect dstRect;
-            dstRect.set(holePunchRect.fLeft, holePunchRect.fTop,
-                        holePunchRect.fRight, holePunchRect.fBottom);
-            dstRect.offset(frameRect().x(), frameRect().y());
-
-            canvas->drawBitmapRect(pluginImage, &srcRect, dstRect, &paint);
-        }
-
-        // Draw the right chunk if needed.
-        if (holePunchRect.fRight < skSrcRect.fRight) {
-            SkIRect srcRect;
-            srcRect.set(holePunchRect.fRight * zoomFactor, holePunchRect.fTop * zoomFactor,
-                        skSrcRect.fRight * zoomFactor, holePunchRect.fBottom * zoomFactor);
-
-            SkRect dstRect;
-            dstRect.set(holePunchRect.fRight, holePunchRect.fTop, skSrcRect.fRight, holePunchRect.fBottom);
-            dstRect.offset(frameRect().x(), frameRect().y());
-
-            canvas->drawBitmapRect(pluginImage, &srcRect, dstRect);
-        }
-
-        // Draw the bottom chunk if needed.
-        if (holePunchRect.fBottom < skSrcRect.fBottom) {
-            SkIRect srcRect;
-            srcRect.set(skSrcRect.fLeft * zoomFactor, holePunchRect.fBottom * zoomFactor,
-                        skSrcRect.fRight * zoomFactor, skSrcRect.fBottom * zoomFactor);
-
-            SkRect dstRect;
-            dstRect.set(skSrcRect.fLeft, holePunchRect.fBottom,
-                        skSrcRect.fRight, skSrcRect.fBottom);
-            dstRect.offset(frameRect().x(), frameRect().y());
-
-            canvas->drawBitmapRect(pluginImage, &srcRect, dstRect);
-        }
-    } else {
-        SkIRect srcRect;
-        srcRect.set(skSrcRect.fLeft * zoomFactor, skSrcRect.fTop * zoomFactor,
-                    skSrcRect.fRight * zoomFactor, skSrcRect.fBottom * zoomFactor);
-
-        // Calculate the destination rectangle.
-        SkRect dstRect;
-        dstRect.set(rectClip.x(), rectClip.y(),
-                    rectClip.x() + rectClip.width(),
-                    rectClip.y() + rectClip.height());
-
-        // Don't punch a hole.
-        canvas->drawBitmapRect(pluginImage, &srcRect, dstRect);
-    }
-
-    context->restore();
-
-    BlackBerry::Platform::Graphics::releaseBufferBackingImage(frontBuffer);
 }