| Index: pdf/paint_manager.cc
|
| diff --git a/pdf/paint_manager.cc b/pdf/paint_manager.cc
|
| index f452b37186e9765ef7f65d37ef629eb5a298a340..925e1a010c063af66454148195809d342e55a582 100644
|
| --- a/pdf/paint_manager.cc
|
| +++ b/pdf/paint_manager.cc
|
| @@ -97,8 +97,8 @@ void PaintManager::SetSize(const pp::Size& new_size, float device_scale) {
|
| }
|
|
|
| void PaintManager::Invalidate() {
|
| - // You must call SetSize before using.
|
| - DCHECK(!graphics_.is_null() || has_pending_resize_);
|
| + if (graphics_.is_null() && !has_pending_resize_)
|
| + return;
|
|
|
| EnsureCallbackPending();
|
| aggregator_.InvalidateRect(pp::Rect(GetEffectiveSize()));
|
| @@ -107,8 +107,8 @@ void PaintManager::Invalidate() {
|
| void PaintManager::InvalidateRect(const pp::Rect& rect) {
|
| DCHECK(!in_paint_);
|
|
|
| - // You must call SetSize before using.
|
| - DCHECK(!graphics_.is_null() || has_pending_resize_);
|
| + if (graphics_.is_null() && !has_pending_resize_)
|
| + return;
|
|
|
| // Clip the rect to the device area.
|
| pp::Rect clipped_rect = rect.Intersect(pp::Rect(GetEffectiveSize()));
|
| @@ -123,8 +123,8 @@ void PaintManager::ScrollRect(const pp::Rect& clip_rect,
|
| const pp::Point& amount) {
|
| DCHECK(!in_paint_);
|
|
|
| - // You must call SetSize before using.
|
| - DCHECK(!graphics_.is_null() || has_pending_resize_);
|
| + if (graphics_.is_null() && !has_pending_resize_)
|
| + return;
|
|
|
| EnsureCallbackPending();
|
|
|
|
|