Changeset 88816 in webkit
- Timestamp:
- Jun 14, 2011 10:13:03 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r88815 r88816 1 2011-06-14 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com> 2 3 Reviewed by Laszlo Gombos. 4 5 [Qt] [Symbian] GraphicsLayer: support plugins on symbian 6 https://bugs.webkit.org/show_bug.cgi?id=57418 7 8 Implement graphics layer for plugins on Symbian. 9 10 * plugins/PluginView.h: 11 * plugins/qt/PluginViewQt.cpp: 12 (WebCore::PluginView::shouldUseAcceleratedCompositing): 13 (WebCore::PluginView::platformStart): 14 * plugins/symbian/PluginViewSymbian.cpp: 15 (WebCore::PluginGraphicsLayerQt::PluginGraphicsLayerQt): 16 (WebCore::PluginGraphicsLayerQt::~PluginGraphicsLayerQt): 17 (WebCore::PluginGraphicsLayerQt::paint): 18 (WebCore::PluginView::shouldUseAcceleratedCompositing): 19 (WebCore::PluginView::paint): 20 (WebCore::PluginView::invalidateRect): 21 (WebCore::PluginView::platformStart): 22 (WebCore::PluginView::platformLayer): 23 1 24 2011-06-14 Sreeram Ramachandran <sreeram@chromium.org> 2 25 -
trunk/Source/WebCore/plugins/PluginView.h
r86276 r88816 69 69 QT_END_NAMESPACE 70 70 #endif 71 #if PLATFORM(QT) && USE(ACCELERATED_COMPOSITING) && ENABLE(NETSCAPE_PLUGIN_API) && (defined(XP_UNIX) || OS(SYMBIAN)) 72 #ifndef WTF_USE_ACCELERATED_COMPOSITING_PLUGIN_LAYER 73 #define WTF_USE_ACCELERATED_COMPOSITING_PLUGIN_LAYER 1 74 #endif 75 #endif 71 76 #if PLATFORM(GTK) 72 77 typedef struct _GtkSocket GtkSocket; … … 260 265 261 266 #if USE(ACCELERATED_COMPOSITING) 262 #if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API) && PLATFORM(QT)267 #if USE(ACCELERATED_COMPOSITING_PLUGIN_LAYER) 263 268 virtual PlatformLayer* platformLayer() const; 269 bool shouldUseAcceleratedCompositing() const; 264 270 #else 265 271 virtual PlatformLayer* platformLayer() const { return 0; } … … 433 439 #if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API) 434 440 void paintUsingXPixmap(QPainter* painter, const QRect &exposedRect); 435 #if USE(ACCELERATED_COMPOSITING) 441 #endif 442 #if USE(ACCELERATED_COMPOSITING_PLUGIN_LAYER) 436 443 OwnPtr<PlatformLayer> m_platformLayer; 437 444 friend class PluginGraphicsLayerQt; 438 #endif // USE(ACCELERATED_COMPOSITING) 439 #endif 445 #endif // USE(ACCELERATED_COMPOSITING_PLUGIN_LAYER) 440 446 #endif // PLATFORM(QT) 441 447 -
trunk/Source/WebCore/plugins/qt/PluginViewQt.cpp
r87429 r88816 121 121 PluginView* m_view; 122 122 }; 123 124 bool PluginView::shouldUseAcceleratedCompositing() const 125 { 126 return m_parentFrame->page()->chrome()->client()->allowsAcceleratedCompositing() 127 && m_parentFrame->page()->settings() 128 && m_parentFrame->page()->settings()->acceleratedCompositingEnabled(); 129 } 123 130 #endif 124 131 … … 960 967 961 968 #if USE(ACCELERATED_COMPOSITING) && !USE(TEXTURE_MAPPER) 962 if (m_parentFrame->page()->chrome()->client()->allowsAcceleratedCompositing() 963 && m_parentFrame->page()->settings() 964 && m_parentFrame->page()->settings()->acceleratedCompositingEnabled()) { 969 if (shouldUseAcceleratedCompositing()) { 965 970 m_platformLayer = adoptPtr(new PluginGraphicsLayerQt(this)); 966 971 // Trigger layer computation in RenderLayerCompositor -
trunk/Source/WebCore/plugins/symbian/PluginViewSymbian.cpp
r84371 r88816 21 21 22 22 #include "BridgeJSC.h" 23 #include "Chrome.h" 24 #include "ChromeClient.h" 23 25 #include "Document.h" 24 26 #include "DocumentLoader.h" … … 60 62 #include <QPixmap> 61 63 #include <QRegion> 64 #include <QStyleOptionGraphicsItem> 62 65 #include <QVector> 63 66 #include <QWidget> … … 86 89 using namespace HTMLNames; 87 90 91 #if USE(ACCELERATED_COMPOSITING) 92 class PluginGraphicsLayerQt : public QGraphicsWidget { 93 public: 94 PluginGraphicsLayerQt(PluginView* view) : m_view(view) 95 { 96 setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); 97 } 98 99 ~PluginGraphicsLayerQt() { } 100 101 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) 102 { 103 Q_UNUSED(widget); 104 105 m_view->m_npWindow.ws_info = (void*)(painter); 106 m_view->setNPWindowIfNeeded(); 107 108 painter->save(); 109 QRectF clipRect(QPointF(0, 0), QSizeF(m_view->frameRect().size())); 110 if (option && !option->exposedRect.isEmpty()) 111 clipRect &= option->exposedRect; 112 painter->setClipRect(clipRect); 113 114 QRect rect = clipRect.toRect(); 115 QPaintEvent ev(rect); 116 QEvent& npEvent = ev; 117 m_view->dispatchNPEvent(npEvent); 118 119 painter->restore(); 120 } 121 122 private: 123 PluginView* m_view; 124 }; 125 126 bool PluginView::shouldUseAcceleratedCompositing() const 127 { 128 return m_parentFrame->page()->chrome()->client()->allowsAcceleratedCompositing() 129 && m_parentFrame->page()->settings() 130 && m_parentFrame->page()->settings()->acceleratedCompositingEnabled(); 131 } 132 #endif 133 88 134 void PluginView::updatePluginWidget() 89 135 { … … 148 194 if (m_isWindowed) 149 195 return; 196 197 #if USE(ACCELERATED_COMPOSITING) 198 if (m_platformLayer) 199 return; 200 #endif 150 201 151 202 context->save(); … … 345 396 void PluginView::invalidateRect(const IntRect& rect) 346 397 { 398 #if USE(ACCELERATED_COMPOSITING) && !USE(TEXTURE_MAPPER) 399 if (m_platformLayer) { 400 m_platformLayer->update(QRectF(rect)); 401 return; 402 } 403 #endif 404 347 405 if (m_isWindowed) { 348 406 platformWidget()->update(rect); … … 416 474 m_npWindow.type = NPWindowTypeDrawable; 417 475 m_npWindow.window = 0; // Not used? 476 #if USE(ACCELERATED_COMPOSITING) && !USE(TEXTURE_MAPPER) 477 if (shouldUseAcceleratedCompositing()) { 478 m_platformLayer = new PluginGraphicsLayerQt(this); 479 m_element->setNeedsStyleRecalc(SyntheticStyleChange); 480 } 481 #endif 418 482 } 419 483 updatePluginWidget(); … … 445 509 } 446 510 511 #if USE(ACCELERATED_COMPOSITING) 512 PlatformLayer* PluginView::platformLayer() const 513 { 514 return m_platformLayer.get(); 515 } 516 #endif 517 447 518 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.