Changeset 79040 in webkit
- Timestamp:
- Feb 18, 2011 3:27:55 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r79030 r79040 1 2011-02-18 Simon Fraser <simon.fraser@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Plugin snapshot location is wrong for subframes 6 https://bugs.webkit.org/show_bug.cgi?id=54776 7 8 Only change the CTM to the way that the plugin expects it 9 when painting the plugin, not when drawing the snapshot. 10 This fixes the snapshot location when painting flattened 11 frames. 12 13 * WebProcess/Plugins/PluginView.cpp: 14 (WebKit::PluginView::paint): 15 1 16 2011-02-18 Anders Carlsson <andersca@apple.com> 2 17 -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r78956 r79040 513 513 514 514 IntRect dirtyRectInWindowCoordinates = parent()->contentsToWindow(dirtyRect); 515 516 515 IntRect paintRectInWindowCoordinates = intersection(dirtyRectInWindowCoordinates, clipRectInWindowCoordinates()); 517 516 if (paintRectInWindowCoordinates.isEmpty()) 518 517 return; 519 518 520 // context is in document coordinates. Translate it to window coordinates.521 IntPoint documentOriginInWindowCoordinates = parent()->contentsToWindow(IntPoint());522 context->save();523 context->translate(-documentOriginInWindowCoordinates.x(), -documentOriginInWindowCoordinates.y());524 525 519 if (m_snapshot) 526 m_snapshot->paint(*context, paintRectInWindowCoordinates.location(), m_snapshot->bounds()); 527 else 528 m_plugin->paint(context, paintRectInWindowCoordinates); 529 530 context->restore(); 520 m_snapshot->paint(*context, frameRect().location(), m_snapshot->bounds()); 521 else { 522 // The plugin is given a frame rect which is parent()->contentsToWindow(frameRect()), 523 // and un-translates by the its origin when painting. The current CTM reflects 524 // this widget's frame is its parent (the document), so we have to offset the CTM by 525 // the document's window coordinates. 526 IntPoint documentOriginInWindowCoordinates = parent()->contentsToWindow(IntPoint()); 527 context->save(); 528 context->translate(-documentOriginInWindowCoordinates.x(), -documentOriginInWindowCoordinates.y()); 529 m_plugin->paint(context, dirtyRect); 530 context->restore(); 531 } 531 532 } 532 533
Note: See TracChangeset
for help on using the changeset viewer.