Title: [147654] trunk/Source/WebCore
Revision
147654
Author
[email protected]
Date
2013-04-04 11:22:17 -0700 (Thu, 04 Apr 2013)

Log Message

[BlackBerry] Remove skia code from PluginViewBlackBerry
https://bugs.webkit.org/show_bug.cgi?id=113936

Patch by Carlos Garcia Campos <[email protected]> on 2013-04-04
Reviewed by Rob Buis.

Skia is not used anymore by the BlackBerry port.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (147653 => 147654)


--- trunk/Source/WebCore/ChangeLog	2013-04-04 18:22:16 UTC (rev 147653)
+++ trunk/Source/WebCore/ChangeLog	2013-04-04 18:22:17 UTC (rev 147654)
@@ -1,3 +1,15 @@
+2013-04-04  Carlos Garcia Campos  <[email protected]>
+
+        [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  <[email protected]>
 
         Change RenderFrameSet::computeEdgeInfo to use m-rows/m_cols directly

Modified: trunk/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp (147653 => 147654)


--- trunk/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp	2013-04-04 18:22:16 UTC (rev 147653)
+++ trunk/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp	2013-04-04 18:22:17 UTC (rev 147654)
@@ -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 @@
     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);
 }
 
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to