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

Side by Side Diff: third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp

Issue 2872423002: Tweak PaintInvalidationReasons (Closed)
Patch Set: Rebaseline-cl Created 3 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 void CaretDisplayItemClient::InvalidatePaintInPreviousLayoutBlock( 204 void CaretDisplayItemClient::InvalidatePaintInPreviousLayoutBlock(
205 const PaintInvalidatorContext& context) { 205 const PaintInvalidatorContext& context) {
206 DCHECK(previous_layout_block_); 206 DCHECK(previous_layout_block_);
207 207
208 ObjectPaintInvalidatorWithContext object_invalidator(*previous_layout_block_, 208 ObjectPaintInvalidatorWithContext object_invalidator(*previous_layout_block_,
209 context); 209 context);
210 if (!IsImmediateFullPaintInvalidationReason( 210 if (!IsImmediateFullPaintInvalidationReason(
211 previous_layout_block_->FullPaintInvalidationReason())) { 211 previous_layout_block_->FullPaintInvalidationReason())) {
212 object_invalidator.InvalidatePaintRectangleWithContext( 212 object_invalidator.InvalidatePaintRectangleWithContext(
213 visual_rect_in_previous_layout_block_, kPaintInvalidationCaret); 213 visual_rect_in_previous_layout_block_, PaintInvalidationReason::kCaret);
214 } 214 }
215 215
216 context.painting_layer->SetNeedsRepaint(); 216 context.painting_layer->SetNeedsRepaint();
217 object_invalidator.InvalidateDisplayItemClient(*this, 217 object_invalidator.InvalidateDisplayItemClient(
218 kPaintInvalidationCaret); 218 *this, PaintInvalidationReason::kCaret);
219 previous_layout_block_ = nullptr; 219 previous_layout_block_ = nullptr;
220 } 220 }
221 221
222 void CaretDisplayItemClient::InvalidatePaintInCurrentLayoutBlock( 222 void CaretDisplayItemClient::InvalidatePaintInCurrentLayoutBlock(
223 const PaintInvalidatorContext& context) { 223 const PaintInvalidatorContext& context) {
224 DCHECK(layout_block_); 224 DCHECK(layout_block_);
225 225
226 LayoutRect new_visual_rect; 226 LayoutRect new_visual_rect;
227 #if DCHECK_IS_ON() 227 #if DCHECK_IS_ON()
228 FindVisualRectNeedingUpdateScope finder(*layout_block_, context, visual_rect_, 228 FindVisualRectNeedingUpdateScope finder(*layout_block_, context, visual_rect_,
(...skipping 25 matching lines...) Expand all
254 // need to invalidate the display item client if the block is doing full 254 // need to invalidate the display item client if the block is doing full
255 // paint invalidation. 255 // paint invalidation.
256 if (IsImmediateFullPaintInvalidationReason( 256 if (IsImmediateFullPaintInvalidationReason(
257 layout_block_->FullPaintInvalidationReason()) || 257 layout_block_->FullPaintInvalidationReason()) ||
258 // For non-SPv2, ForcedSubtreeInvalidationChecking may hint change of 258 // For non-SPv2, ForcedSubtreeInvalidationChecking may hint change of
259 // paint offset. See ObjectPaintInvalidatorWithContext:: 259 // paint offset. See ObjectPaintInvalidatorWithContext::
260 // invalidatePaintIfNeededWithComputedReason(). 260 // invalidatePaintIfNeededWithComputedReason().
261 (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && 261 (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
262 (context.forced_subtree_invalidation_flags & 262 (context.forced_subtree_invalidation_flags &
263 PaintInvalidatorContext::kForcedSubtreeInvalidationChecking))) { 263 PaintInvalidatorContext::kForcedSubtreeInvalidationChecking))) {
264 object_invalidator.InvalidateDisplayItemClient(*this, 264 object_invalidator.InvalidateDisplayItemClient(
265 kPaintInvalidationCaret); 265 *this, PaintInvalidationReason::kCaret);
266 } 266 }
267 return; 267 return;
268 } 268 }
269 269
270 needs_paint_invalidation_ = false; 270 needs_paint_invalidation_ = false;
271 271
272 if (!IsImmediateFullPaintInvalidationReason( 272 if (!IsImmediateFullPaintInvalidationReason(
273 layout_block_->FullPaintInvalidationReason())) { 273 layout_block_->FullPaintInvalidationReason())) {
274 object_invalidator.FullyInvalidatePaint(kPaintInvalidationCaret, 274 object_invalidator.FullyInvalidatePaint(PaintInvalidationReason::kCaret,
275 visual_rect_, new_visual_rect); 275 visual_rect_, new_visual_rect);
276 } 276 }
277 277
278 context.painting_layer->SetNeedsRepaint(); 278 context.painting_layer->SetNeedsRepaint();
279 object_invalidator.InvalidateDisplayItemClient(*this, 279 object_invalidator.InvalidateDisplayItemClient(
280 kPaintInvalidationCaret); 280 *this, PaintInvalidationReason::kCaret);
281 281
282 visual_rect_ = new_visual_rect; 282 visual_rect_ = new_visual_rect;
283 } 283 }
284 284
285 void CaretDisplayItemClient::PaintCaret( 285 void CaretDisplayItemClient::PaintCaret(
286 GraphicsContext& context, 286 GraphicsContext& context,
287 const LayoutPoint& paint_offset, 287 const LayoutPoint& paint_offset,
288 DisplayItem::Type display_item_type) const { 288 DisplayItem::Type display_item_type) const {
289 if (DrawingRecorder::UseCachedDrawingIfPossible(context, *this, 289 if (DrawingRecorder::UseCachedDrawingIfPossible(context, *this,
290 display_item_type)) 290 display_item_type))
(...skipping 10 matching lines...) Expand all
301 301
302 String CaretDisplayItemClient::DebugName() const { 302 String CaretDisplayItemClient::DebugName() const {
303 return "Caret"; 303 return "Caret";
304 } 304 }
305 305
306 LayoutRect CaretDisplayItemClient::VisualRect() const { 306 LayoutRect CaretDisplayItemClient::VisualRect() const {
307 return visual_rect_; 307 return visual_rect_;
308 } 308 }
309 309
310 } // namespace blink 310 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698