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

Unified Diff: pdf/paint_manager.cc

Issue 2641163002: [pdf] Allow invalidation during paint.
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/paint_manager.cc
diff --git a/pdf/paint_manager.cc b/pdf/paint_manager.cc
index ea9cc7814679f0c077ce1e0861a83fab2d4fef93..28406d904f4b6d04794e24fc2954a58ff8ec1079 100644
--- a/pdf/paint_manager.cc
+++ b/pdf/paint_manager.cc
@@ -141,8 +141,9 @@ void PaintManager::Invalidate() {
}
void PaintManager::InvalidateRect(const pp::Rect& rect) {
- DCHECK(!in_paint_);
-
+ // Note, we can't DCHECK(!in_paint_) here because javascript inside the
Tom Sepez 2017/01/19 17:43:37 Do we just want to no-op it in this special case?
dsinclair 2017/01/19 18:56:10 I don't know. My concern when I did this originall
+ // PDF can trigger at any point. So, while we're attempting to paint it's
+ // possible for the JS to trigger and cause an invalidation.
if (graphics_.is_null() && !has_pending_resize_)
return;
@@ -151,7 +152,8 @@ void PaintManager::InvalidateRect(const pp::Rect& rect) {
if (clipped_rect.IsEmpty())
return; // Nothing to do.
- EnsureCallbackPending();
+ if (!in_paint_)
+ EnsureCallbackPending();
aggregator_.InvalidateRect(clipped_rect);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698