| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_webLayer) { | 127 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_webLayer) { |
| 128 // With Slimming Paint v2, composited plugins should have their layers | 128 // With Slimming Paint v2, composited plugins should have their layers |
| 129 // inserted rather than invoking WebPlugin::paint. | 129 // inserted rather than invoking WebPlugin::paint. |
| 130 recordForeignLayer( | 130 recordForeignLayer( |
| 131 context, *m_element->layoutObject(), DisplayItem::ForeignLayerPlugin
, | 131 context, *m_element->layoutObject(), DisplayItem::ForeignLayerPlugin
, |
| 132 m_webLayer, location(), size()); | 132 m_webLayer, location(), size()); |
| 133 return; | 133 return; |
| 134 } | 134 } |
| 135 | 135 |
| 136 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, *m_elem
ent->layoutObject(), DisplayItem::Type::WebPlugin, LayoutPoint())) | 136 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, *m_elem
ent->layoutObject(), DisplayItem::Type::WebPlugin)) |
| 137 return; | 137 return; |
| 138 | 138 |
| 139 LayoutObjectDrawingRecorder drawingRecorder(context, *m_element->layoutObjec
t(), DisplayItem::Type::WebPlugin, cullRect.m_rect, LayoutPoint()); | 139 LayoutObjectDrawingRecorder drawingRecorder(context, *m_element->layoutObjec
t(), DisplayItem::Type::WebPlugin, cullRect.m_rect); |
| 140 context.save(); | 140 context.save(); |
| 141 | 141 |
| 142 ASSERT(parent()->isFrameView()); | 142 ASSERT(parent()->isFrameView()); |
| 143 FrameView* view = toFrameView(parent()); | 143 FrameView* view = toFrameView(parent()); |
| 144 | 144 |
| 145 // The plugin is positioned in the root frame's coordinates, so it needs to | 145 // The plugin is positioned in the root frame's coordinates, so it needs to |
| 146 // be painted in them too. | 146 // be painted in them too. |
| 147 IntPoint origin = view->contentsToRootFrame(IntPoint(0, 0)); | 147 IntPoint origin = view->contentsToRootFrame(IntPoint(0, 0)); |
| 148 context.translate(static_cast<float>(-origin.x()), static_cast<float>(-origi
n.y())); | 148 context.translate(static_cast<float>(-origin.x()), static_cast<float>(-origi
n.y())); |
| 149 | 149 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 return m_webPlugin->getPrintPresetOptionsFromDocument(presetOptions); | 346 return m_webPlugin->getPrintPresetOptionsFromDocument(presetOptions); |
| 347 } | 347 } |
| 348 | 348 |
| 349 int WebPluginContainerImpl::printBegin(const WebPrintParams& printParams) const | 349 int WebPluginContainerImpl::printBegin(const WebPrintParams& printParams) const |
| 350 { | 350 { |
| 351 return m_webPlugin->printBegin(printParams); | 351 return m_webPlugin->printBegin(printParams); |
| 352 } | 352 } |
| 353 | 353 |
| 354 void WebPluginContainerImpl::printPage(int pageNumber, GraphicsContext& gc, cons
t IntRect& printRect) | 354 void WebPluginContainerImpl::printPage(int pageNumber, GraphicsContext& gc, cons
t IntRect& printRect) |
| 355 { | 355 { |
| 356 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(gc, *m_element->
layoutObject(), DisplayItem::Type::WebPlugin, LayoutPoint())) | 356 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(gc, *m_element->
layoutObject(), DisplayItem::Type::WebPlugin)) |
| 357 return; | 357 return; |
| 358 | 358 |
| 359 LayoutObjectDrawingRecorder drawingRecorder(gc, *m_element->layoutObject(),
DisplayItem::Type::WebPlugin, printRect, LayoutPoint()); | 359 LayoutObjectDrawingRecorder drawingRecorder(gc, *m_element->layoutObject(),
DisplayItem::Type::WebPlugin, printRect); |
| 360 gc.save(); | 360 gc.save(); |
| 361 WebCanvas* canvas = gc.canvas(); | 361 WebCanvas* canvas = gc.canvas(); |
| 362 m_webPlugin->printPage(pageNumber, canvas); | 362 m_webPlugin->printPage(pageNumber, canvas); |
| 363 gc.restore(); | 363 gc.restore(); |
| 364 } | 364 } |
| 365 | 365 |
| 366 void WebPluginContainerImpl::printEnd() | 366 void WebPluginContainerImpl::printEnd() |
| 367 { | 367 { |
| 368 m_webPlugin->printEnd(); | 368 m_webPlugin->printEnd(); |
| 369 } | 369 } |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 // frame view. | 975 // frame view. |
| 976 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec
t); | 976 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec
t); |
| 977 } | 977 } |
| 978 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); | 978 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); |
| 979 // Convert to the plugin position. | 979 // Convert to the plugin position. |
| 980 for (size_t i = 0; i < cutOutRects.size(); i++) | 980 for (size_t i = 0; i < cutOutRects.size(); i++) |
| 981 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 981 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
| 982 } | 982 } |
| 983 | 983 |
| 984 } // namespace blink | 984 } // namespace blink |
| OLD | NEW |