Changeset 147654 in webkit
- Timestamp:
- Apr 4, 2013 11:22:17 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r147645 r147654 1 2013-04-04 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [BlackBerry] Remove skia code from PluginViewBlackBerry 4 https://bugs.webkit.org/show_bug.cgi?id=113936 5 6 Reviewed by Rob Buis. 7 8 Skia is not used anymore by the BlackBerry port. 9 10 * plugins/blackberry/PluginViewBlackBerry.cpp: 11 (WebCore::PluginView::paint): 12 1 13 2013-04-04 Emil A Eklund <eae@chromium.org> 2 14 -
trunk/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp
r145913 r147654 44 44 #include "NotImplemented.h" 45 45 #include "Page.h" 46 #include "PlatformContextSkia.h"47 46 #include "PlatformKeyboardEvent.h" 48 47 #include "PluginDebug.h" … … 247 246 248 247 updateBuffer(exposedRect); 249 250 PthreadReadLocker frontLock(&m_private->m_frontBufferRwLock);251 252 BlackBerry::Platform::Graphics::Buffer* frontBuffer =253 m_private->m_pluginBuffers[m_private->m_pluginFrontBuffer];254 255 // Don't paint anything if there is no buffer.256 if (!frontBuffer)257 return;258 259 const BlackBerry::Platform::Graphics::BackingImage* backingImage =260 BlackBerry::Platform::Graphics::lockBufferBackingImage(frontBuffer,261 BlackBerry::Platform::Graphics::ReadAccess);262 if (!backingImage)263 return;264 265 // Draw the changed buffer contents to the screen.266 context->save();267 268 const SkBitmap& pluginImage = *backingImage;269 PlatformGraphicsContext* graphics = context->platformContext();270 ASSERT(graphics);271 SkCanvas* canvas = graphics->canvas();272 273 // Source rectangle we will draw to the screen.274 SkIRect skSrcRect;275 skSrcRect.set(exposedRect.x(), exposedRect.y(),276 exposedRect.x() + exposedRect.width(),277 exposedRect.y() + exposedRect.height());278 279 // Prepare the hole punch rectangle.280 SkIRect unclippedHolePunchRect;281 unclippedHolePunchRect.set(m_private->m_holePunchRect.x(),282 m_private->m_holePunchRect.y(),283 m_private->m_holePunchRect.x() + m_private->m_holePunchRect.width(),284 m_private->m_holePunchRect.y() + m_private->m_holePunchRect.height());285 286 // holePunchRect is clipped.287 SkIRect holePunchRect;288 289 // All source rectangles are scaled by the zoom factor because the source bitmap may be a290 // higher resolution than the 1:1 page. This allows the flash player to scale the content291 // it is drawing to match the scale of the page.292 double zoomFactorH = static_cast<double>(m_private->m_pluginBufferSize.width()) / static_cast<double>(frameRect().width());293 double zoomFactorW = static_cast<double>(m_private->m_pluginBufferSize.height()) / static_cast<double>(frameRect().height());294 double zoomFactor = (zoomFactorH + zoomFactorW) / 2.0;295 296 // This method draws a hole if specified.297 if (!m_private->m_holePunchRect.isEmpty()298 && holePunchRect.intersect(unclippedHolePunchRect, skSrcRect)) {299 300 // Draw the top chunk if needed.301 if (holePunchRect.fTop > skSrcRect.fTop) {302 SkIRect srcRect;303 srcRect.set(skSrcRect.fLeft * zoomFactor, skSrcRect.fTop * zoomFactor,304 skSrcRect.fRight * zoomFactor, holePunchRect.fTop * zoomFactor);305 306 SkRect dstRect;307 dstRect.set(skSrcRect.fLeft, skSrcRect.fTop,308 skSrcRect.fRight, holePunchRect.fTop);309 dstRect.offset(frameRect().x(), frameRect().y());310 311 canvas->drawBitmapRect(pluginImage, &srcRect, dstRect);312 }313 314 // Draw the left chunk if needed.315 if (holePunchRect.fLeft > skSrcRect.fLeft) {316 SkIRect srcRect;317 srcRect.set(skSrcRect.fLeft * zoomFactor, holePunchRect.fTop * zoomFactor,318 holePunchRect.fLeft * zoomFactor, holePunchRect.fBottom * zoomFactor);319 320 SkRect dstRect;321 dstRect.set(skSrcRect.fLeft, holePunchRect.fTop,322 holePunchRect.fLeft, holePunchRect.fBottom);323 dstRect.offset(frameRect().x(), frameRect().y());324 325 canvas->drawBitmapRect(pluginImage, &srcRect, dstRect);326 }327 328 // Draw the hole chunk.329 {330 SkPaint paint;331 paint.setXfermodeMode(SkXfermode::kSrc_Mode);332 333 SkIRect srcRect;334 srcRect.set(holePunchRect.fLeft * zoomFactor, holePunchRect.fTop * zoomFactor,335 holePunchRect.fRight * zoomFactor, holePunchRect.fBottom * zoomFactor);336 337 SkRect dstRect;338 dstRect.set(holePunchRect.fLeft, holePunchRect.fTop,339 holePunchRect.fRight, holePunchRect.fBottom);340 dstRect.offset(frameRect().x(), frameRect().y());341 342 canvas->drawBitmapRect(pluginImage, &srcRect, dstRect, &paint);343 }344 345 // Draw the right chunk if needed.346 if (holePunchRect.fRight < skSrcRect.fRight) {347 SkIRect srcRect;348 srcRect.set(holePunchRect.fRight * zoomFactor, holePunchRect.fTop * zoomFactor,349 skSrcRect.fRight * zoomFactor, holePunchRect.fBottom * zoomFactor);350 351 SkRect dstRect;352 dstRect.set(holePunchRect.fRight, holePunchRect.fTop, skSrcRect.fRight, holePunchRect.fBottom);353 dstRect.offset(frameRect().x(), frameRect().y());354 355 canvas->drawBitmapRect(pluginImage, &srcRect, dstRect);356 }357 358 // Draw the bottom chunk if needed.359 if (holePunchRect.fBottom < skSrcRect.fBottom) {360 SkIRect srcRect;361 srcRect.set(skSrcRect.fLeft * zoomFactor, holePunchRect.fBottom * zoomFactor,362 skSrcRect.fRight * zoomFactor, skSrcRect.fBottom * zoomFactor);363 364 SkRect dstRect;365 dstRect.set(skSrcRect.fLeft, holePunchRect.fBottom,366 skSrcRect.fRight, skSrcRect.fBottom);367 dstRect.offset(frameRect().x(), frameRect().y());368 369 canvas->drawBitmapRect(pluginImage, &srcRect, dstRect);370 }371 } else {372 SkIRect srcRect;373 srcRect.set(skSrcRect.fLeft * zoomFactor, skSrcRect.fTop * zoomFactor,374 skSrcRect.fRight * zoomFactor, skSrcRect.fBottom * zoomFactor);375 376 // Calculate the destination rectangle.377 SkRect dstRect;378 dstRect.set(rectClip.x(), rectClip.y(),379 rectClip.x() + rectClip.width(),380 rectClip.y() + rectClip.height());381 382 // Don't punch a hole.383 canvas->drawBitmapRect(pluginImage, &srcRect, dstRect);384 }385 386 context->restore();387 388 BlackBerry::Platform::Graphics::releaseBufferBackingImage(frontBuffer);389 248 } 390 249
Note: See TracChangeset
for help on using the changeset viewer.