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

Side by Side Diff: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp

Issue 2296203002: Make CaretBase a DisplayItemClient. (Closed)
Patch Set: Created 4 years, 3 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/core/paint/ObjectPaintInvalidator.h ('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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/ObjectPaintInvalidator.h" 5 #include "core/paint/ObjectPaintInvalidator.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/layout/LayoutBlockFlow.h" 9 #include "core/layout/LayoutBlockFlow.h"
10 #include "core/layout/compositing/CompositedLayerMapping.h" 10 #include "core/layout/compositing/CompositedLayerMapping.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 // This conditional handles situations where non-rooted (and hence non-compo sited) frames are 268 // This conditional handles situations where non-rooted (and hence non-compo sited) frames are
269 // painted, such as SVG images. 269 // painted, such as SVG images.
270 if (!paintInvalidationContainer.isPaintInvalidationContainer()) 270 if (!paintInvalidationContainer.isPaintInvalidationContainer())
271 invalidatePaintRectangleOnWindow(paintInvalidationContainer, enclosingIn tRect(dirtyRect)); 271 invalidatePaintRectangleOnWindow(paintInvalidationContainer, enclosingIn tRect(dirtyRect));
272 272
273 if (paintInvalidationContainer.view()->usesCompositing() && paintInvalidatio nContainer.isPaintInvalidationContainer()) 273 if (paintInvalidationContainer.view()->usesCompositing() && paintInvalidatio nContainer.isPaintInvalidationContainer())
274 setBackingNeedsPaintInvalidationInRect(paintInvalidationContainer, dirty Rect, invalidationReason); 274 setBackingNeedsPaintInvalidationInRect(paintInvalidationContainer, dirty Rect, invalidationReason);
275 } 275 }
276 276
277 void ObjectPaintInvalidator::invalidatePaintRectangle(const LayoutRect& dirtyRec t, DisplayItemClient* displayItemClient) 277 LayoutRect ObjectPaintInvalidator::invalidatePaintRectangle(const LayoutRect& di rtyRect, DisplayItemClient* displayItemClient)
278 { 278 {
279 CHECK(m_object.isRooted()); 279 CHECK(m_object.isRooted());
280 280
281 if (dirtyRect.isEmpty()) 281 if (dirtyRect.isEmpty())
282 return; 282 return LayoutRect();
283 283
284 if (m_object.view()->document().printing()) 284 if (m_object.view()->document().printing())
285 return; // Don't invalidate paints if we're printing. 285 return LayoutRect(); // Don't invalidate paints if we're printing.
286 286
287 const LayoutBoxModelObject& paintInvalidationContainer = m_object.containerF orPaintInvalidation(); 287 const LayoutBoxModelObject& paintInvalidationContainer = m_object.containerF orPaintInvalidation();
288 LayoutRect dirtyRectOnBacking = dirtyRect; 288 LayoutRect dirtyRectOnBacking = dirtyRect;
289 PaintLayer::mapRectToPaintInvalidationBacking(m_object, paintInvalidationCon tainer, dirtyRectOnBacking); 289 PaintLayer::mapRectToPaintInvalidationBacking(m_object, paintInvalidationCon tainer, dirtyRectOnBacking);
290 dirtyRectOnBacking.move(m_object.scrollAdjustmentForPaintInvalidation(paintI nvalidationContainer)); 290 dirtyRectOnBacking.move(m_object.scrollAdjustmentForPaintInvalidation(paintI nvalidationContainer));
291 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking , PaintInvalidationRectangle); 291 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking , PaintInvalidationRectangle);
292 292
293 slowSetPaintingLayerNeedsRepaint(); 293 slowSetPaintingLayerNeedsRepaint();
294 if (displayItemClient) 294 if (displayItemClient)
295 invalidateDisplayItemClient(*displayItemClient, PaintInvalidationRectang le); 295 invalidateDisplayItemClient(*displayItemClient, PaintInvalidationRectang le);
296 else 296 else
297 m_object.invalidateDisplayItemClients(PaintInvalidationRectangle); 297 m_object.invalidateDisplayItemClients(PaintInvalidationRectangle);
298
299 return dirtyRectOnBacking;
298 } 300 }
299 301
300 void ObjectPaintInvalidator::slowSetPaintingLayerNeedsRepaint() 302 void ObjectPaintInvalidator::slowSetPaintingLayerNeedsRepaint()
301 { 303 {
302 if (PaintLayer* paintingLayer = m_object.paintingLayer()) 304 if (PaintLayer* paintingLayer = m_object.paintingLayer())
303 paintingLayer->setNeedsRepaint(); 305 paintingLayer->setNeedsRepaint();
304 } 306 }
305 307
306 bool ObjectPaintInvalidatorWithContext::incrementallyInvalidatePaint() 308 bool ObjectPaintInvalidatorWithContext::incrementallyInvalidatePaint()
307 { 309 {
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 m_object.invalidateDisplayItemClients(reason); 471 m_object.invalidateDisplayItemClients(reason);
470 return reason; 472 return reason;
471 } 473 }
472 474
473 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() 475 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts()
474 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) 476 : m_disabler(&gDisablePaintInvalidationStateAsserts, true)
475 { 477 {
476 } 478 }
477 479
478 } // namespace blink 480 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698