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);
}