PassRefPtr<ShareableBitmap> NetscapePlugin::snapshot() { if (!supportsSnapshotting() || m_frameRect.isEmpty()) return 0; ASSERT(m_isStarted); RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(m_frameRect.size(), ShareableBitmap::SupportsAlpha); OwnPtr<GraphicsContext> context = bitmap->createGraphicsContext(); context->translate(-m_frameRect.x(), -m_frameRect.y()); platformPaint(context.get(), m_frameRect, true); return bitmap.release(); }
PassRefPtr<ShareableBitmap> NetscapePlugin::snapshot() { if (!supportsSnapshotting() || m_pluginSize.isEmpty()) return 0; ASSERT(m_isStarted); IntSize backingStoreSize = m_pluginSize; backingStoreSize.scale(contentsScaleFactor()); RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(backingStoreSize, ShareableBitmap::SupportsAlpha); OwnPtr<GraphicsContext> context = bitmap->createGraphicsContext(); // FIXME: We should really call applyDeviceScaleFactor instead of scale, but that ends up calling into WKSI // which we currently don't have initiated in the plug-in process. context->scale(FloatSize(contentsScaleFactor(), contentsScaleFactor())); platformPaint(context.get(), IntRect(IntPoint(), m_pluginSize), true); return bitmap.release(); }