Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(681)

Side by Side Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 1391753005: (WIP) Invalidation during painting (for synchronized painting) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 void WebPluginContainerImpl::paint(GraphicsContext& context, const CullRect& cul lRect) const 116 void WebPluginContainerImpl::paint(GraphicsContext& context, const CullRect& cul lRect) const
117 { 117 {
118 if (!parent()) 118 if (!parent())
119 return; 119 return;
120 120
121 // Don't paint anything if the plugin doesn't intersect. 121 // Don't paint anything if the plugin doesn't intersect.
122 if (!cullRect.intersectsCullRect(frameRect())) 122 if (!cullRect.intersectsCullRect(frameRect()))
123 return; 123 return;
124 124
125 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, *m_elem ent->layoutObject(), DisplayItem::Type::WebPlugin, LayoutPoint())) 125 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, *m_elem ent->layoutObject(), DisplayItem::Type::WebPlugin))
126 return; 126 return;
127 127
128 LayoutObjectDrawingRecorder drawingRecorder(context, *m_element->layoutObjec t(), DisplayItem::Type::WebPlugin, cullRect.m_rect, LayoutPoint()); 128 LayoutObjectDrawingRecorder drawingRecorder(context, *m_element->layoutObjec t(), DisplayItem::Type::WebPlugin, cullRect.m_rect);
129 context.save(); 129 context.save();
130 130
131 ASSERT(parent()->isFrameView()); 131 ASSERT(parent()->isFrameView());
132 FrameView* view = toFrameView(parent()); 132 FrameView* view = toFrameView(parent());
133 133
134 // The plugin is positioned in the root frame's coordinates, so it needs to 134 // The plugin is positioned in the root frame's coordinates, so it needs to
135 // be painted in them too. 135 // be painted in them too.
136 IntPoint origin = view->contentsToRootFrame(IntPoint(0, 0)); 136 IntPoint origin = view->contentsToRootFrame(IntPoint(0, 0));
137 context.translate(static_cast<float>(-origin.x()), static_cast<float>(-origi n.y())); 137 context.translate(static_cast<float>(-origin.x()), static_cast<float>(-origi n.y()));
138 138
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 return m_webPlugin->getPrintPresetOptionsFromDocument(presetOptions); 335 return m_webPlugin->getPrintPresetOptionsFromDocument(presetOptions);
336 } 336 }
337 337
338 int WebPluginContainerImpl::printBegin(const WebPrintParams& printParams) const 338 int WebPluginContainerImpl::printBegin(const WebPrintParams& printParams) const
339 { 339 {
340 return m_webPlugin->printBegin(printParams); 340 return m_webPlugin->printBegin(printParams);
341 } 341 }
342 342
343 void WebPluginContainerImpl::printPage(int pageNumber, GraphicsContext& gc, cons t IntRect& printRect) 343 void WebPluginContainerImpl::printPage(int pageNumber, GraphicsContext& gc, cons t IntRect& printRect)
344 { 344 {
345 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(gc, *m_element-> layoutObject(), DisplayItem::Type::WebPlugin, LayoutPoint())) 345 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(gc, *m_element-> layoutObject(), DisplayItem::Type::WebPlugin))
346 return; 346 return;
347 347
348 LayoutObjectDrawingRecorder drawingRecorder(gc, *m_element->layoutObject(), DisplayItem::Type::WebPlugin, printRect, LayoutPoint()); 348 LayoutObjectDrawingRecorder drawingRecorder(gc, *m_element->layoutObject(), DisplayItem::Type::WebPlugin, printRect);
349 gc.save(); 349 gc.save();
350 WebCanvas* canvas = gc.canvas(); 350 WebCanvas* canvas = gc.canvas();
351 m_webPlugin->printPage(pageNumber, canvas); 351 m_webPlugin->printPage(pageNumber, canvas);
352 gc.restore(); 352 gc.restore();
353 } 353 }
354 354
355 void WebPluginContainerImpl::printEnd() 355 void WebPluginContainerImpl::printEnd()
356 { 356 {
357 m_webPlugin->printEnd(); 357 m_webPlugin->printEnd();
358 } 358 }
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 // frame view. 964 // frame view.
965 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t); 965 computeClipRectsForPlugin(m_element, windowRect, clipRect, unobscuredRec t);
966 } 966 }
967 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects); 967 getPluginOcclusions(m_element, this->parent(), frameRect(), cutOutRects);
968 // Convert to the plugin position. 968 // Convert to the plugin position.
969 for (size_t i = 0; i < cutOutRects.size(); i++) 969 for (size_t i = 0; i < cutOutRects.size(); i++)
970 cutOutRects[i].move(-frameRect().x(), -frameRect().y()); 970 cutOutRects[i].move(-frameRect().x(), -frameRect().y());
971 } 971 }
972 972
973 } // namespace blink 973 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698