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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 bool WebPluginContainerImpl::getPrintPresetOptionsFromDocument(WebPrintPresetOpt
ions* presetOptions) const | 345 bool WebPluginContainerImpl::getPrintPresetOptionsFromDocument(WebPrintPresetOpt
ions* presetOptions) const |
346 { | 346 { |
347 return m_webPlugin->getPrintPresetOptionsFromDocument(presetOptions); | 347 return m_webPlugin->getPrintPresetOptionsFromDocument(presetOptions); |
348 } | 348 } |
349 | 349 |
350 int WebPluginContainerImpl::printBegin(const WebPrintParams& printParams) const | 350 int WebPluginContainerImpl::printBegin(const WebPrintParams& printParams) const |
351 { | 351 { |
352 return m_webPlugin->printBegin(printParams); | 352 return m_webPlugin->printBegin(printParams); |
353 } | 353 } |
354 | 354 |
355 bool WebPluginContainerImpl::printPage(int pageNumber, GraphicsContext* gc) | 355 bool WebPluginContainerImpl::printPage(int pageNumber, GraphicsContext* gc, cons
t IntRect& printRect) |
356 { | 356 { |
| 357 LayoutObjectDrawingRecorder drawingRecorder(*gc, *m_element->layoutObject(),
DisplayItem::Type::WebPlugin, printRect); |
| 358 if (drawingRecorder.canUseCachedDrawing()) |
| 359 return true; |
357 gc->save(); | 360 gc->save(); |
358 WebCanvas* canvas = gc->canvas(); | 361 WebCanvas* canvas = gc->canvas(); |
359 bool ret = m_webPlugin->printPage(pageNumber, canvas); | 362 bool ret = m_webPlugin->printPage(pageNumber, canvas); |
360 gc->restore(); | 363 gc->restore(); |
361 return ret; | 364 return ret; |
362 } | 365 } |
363 | 366 |
364 void WebPluginContainerImpl::printEnd() | 367 void WebPluginContainerImpl::printEnd() |
365 { | 368 { |
366 m_webPlugin->printEnd(); | 369 m_webPlugin->printEnd(); |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 for (size_t i = 0; i < cutOutRects.size(); i++) | 969 for (size_t i = 0; i < cutOutRects.size(); i++) |
967 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); | 970 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); |
968 } | 971 } |
969 | 972 |
970 bool WebPluginContainerImpl::pluginShouldPersist() const | 973 bool WebPluginContainerImpl::pluginShouldPersist() const |
971 { | 974 { |
972 return m_webPlugin->shouldPersist(); | 975 return m_webPlugin->shouldPersist(); |
973 } | 976 } |
974 | 977 |
975 } // namespace blink | 978 } // namespace blink |
OLD | NEW |