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

Side by Side Diff: ui/aura/window.cc

Issue 464643003: Stop painting when receiving delegated frame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unittest DCHECK OOPS Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 484
485 void Window::SchedulePaintInRect(const gfx::Rect& rect) { 485 void Window::SchedulePaintInRect(const gfx::Rect& rect) {
486 if (!layer() && parent_) { 486 if (!layer() && parent_) {
487 // Notification of paint scheduled happens for the window with a layer. 487 // Notification of paint scheduled happens for the window with a layer.
488 gfx::Rect parent_rect(bounds().size()); 488 gfx::Rect parent_rect(bounds().size());
489 parent_rect.Intersect(rect); 489 parent_rect.Intersect(rect);
490 if (!parent_rect.IsEmpty()) { 490 if (!parent_rect.IsEmpty()) {
491 parent_rect.Offset(bounds().origin().OffsetFromOrigin()); 491 parent_rect.Offset(bounds().origin().OffsetFromOrigin());
492 parent_->SchedulePaintInRect(parent_rect); 492 parent_->SchedulePaintInRect(parent_rect);
493 } 493 }
494 } else if (layer() && layer()->SchedulePaint(rect)) { 494 } else if (layer()) {
495 FOR_EACH_OBSERVER( 495 layer()->SchedulePaint(rect);
496 WindowObserver, observers_, OnWindowPaintScheduled(this, rect));
497 } 496 }
498 } 497 }
499 498
499 void Window::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) {
500 DCHECK(layer());
501 FOR_EACH_OBSERVER(WindowObserver,
502 observers_,
503 OnDelegatedFrameDamage(this, damage_rect_in_dip));
504 }
505
500 void Window::StackChildAtTop(Window* child) { 506 void Window::StackChildAtTop(Window* child) {
501 if (children_.size() <= 1 || child == children_.back()) 507 if (children_.size() <= 1 || child == children_.back())
502 return; // In the front already. 508 return; // In the front already.
503 StackChildAbove(child, children_.back()); 509 StackChildAbove(child, children_.back());
504 } 510 }
505 511
506 void Window::StackChildAbove(Window* child, Window* target) { 512 void Window::StackChildAbove(Window* child, Window* target) {
507 StackChildRelativeTo(child, target, STACK_ABOVE); 513 StackChildRelativeTo(child, target, STACK_ABOVE);
508 } 514 }
509 515
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 return window; 1449 return window;
1444 if (offset) 1450 if (offset)
1445 *offset += window->bounds().OffsetFromOrigin(); 1451 *offset += window->bounds().OffsetFromOrigin();
1446 } 1452 }
1447 if (offset) 1453 if (offset)
1448 *offset = gfx::Vector2d(); 1454 *offset = gfx::Vector2d();
1449 return NULL; 1455 return NULL;
1450 } 1456 }
1451 1457
1452 } // namespace aura 1458 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698