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

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 168193002: Fix compositing chicken and egg problem in updateControlTints. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after
2616 { 2616 {
2617 // This is called when control tints are changed from aqua/graphite to clear and vice versa. 2617 // This is called when control tints are changed from aqua/graphite to clear and vice versa.
2618 // We do a "fake" paint, and when the theme gets a paint call, it can then d o an invalidate. 2618 // We do a "fake" paint, and when the theme gets a paint call, it can then d o an invalidate.
2619 // This is only done if the theme supports control tinting. It's up to the t heme and platform 2619 // This is only done if the theme supports control tinting. It's up to the t heme and platform
2620 // to define when controls get the tint and to call this function when that changes. 2620 // to define when controls get the tint and to call this function when that changes.
2621 2621
2622 // Optimize the common case where we bring a window to the front while it's still empty. 2622 // Optimize the common case where we bring a window to the front while it's still empty.
2623 if (m_frame->document()->url().isEmpty()) 2623 if (m_frame->document()->url().isEmpty())
2624 return; 2624 return;
2625 2625
2626 if (RenderTheme::theme().supportsControlTints() || hasCustomScrollbars()) 2626 if (RenderTheme::theme().supportsControlTints() || hasCustomScrollbars()) {
2627 updateLayoutAndStyleForPainting();
2627 paintControlTints(); 2628 paintControlTints();
2629 }
2628 } 2630 }
2629 2631
2630 void FrameView::paintControlTints() 2632 void FrameView::paintControlTints()
2631 { 2633 {
2632 if (needsLayout()) 2634 if (needsLayout())
2633 layout(); 2635 layout();
2634 // FIXME: The use of paint seems like overkill: crbug.com/236892 2636 // FIXME: The use of paint seems like overkill: crbug.com/236892
2635 GraphicsContext context(0); // NULL canvas to get a non-painting context. 2637 GraphicsContext context(0); // NULL canvas to get a non-painting context.
2636 context.setUpdatingControlTints(true); 2638 context.setUpdatingControlTints(true);
2637 paint(&context, frameRect()); 2639 paint(&context, frameRect());
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 return; 2771 return;
2770 2772
2771 if (isMainFrame()) { 2773 if (isMainFrame()) {
2772 if (m_frame->page()->chrome().client().paintCustomOverhangArea(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect)) 2774 if (m_frame->page()->chrome().client().paintCustomOverhangArea(context, horizontalOverhangArea, verticalOverhangArea, dirtyRect))
2773 return; 2775 return;
2774 } 2776 }
2775 2777
2776 ScrollView::paintOverhangAreas(context, horizontalOverhangArea, verticalOver hangArea, dirtyRect); 2778 ScrollView::paintOverhangAreas(context, horizontalOverhangArea, verticalOver hangArea, dirtyRect);
2777 } 2779 }
2778 2780
2781 void FrameView::updateLayoutAndStyleForPainting()
2782 {
abarth-chromium 2014/02/15 07:12:19 Don't we need to hold a RefPtr<FrameView> protecto
ojan 2014/02/18 18:52:41 :(
2783 updateLayoutAndStyleIfNeededRecursive();
2784 if (RenderView* view = renderView())
2785 view->compositor()->updateCompositingLayers();
2786 }
2787
2779 void FrameView::updateLayoutAndStyleIfNeededRecursive() 2788 void FrameView::updateLayoutAndStyleIfNeededRecursive()
2780 { 2789 {
2781 // We have to crawl our entire tree looking for any FrameViews that need 2790 // We have to crawl our entire tree looking for any FrameViews that need
2782 // layout and make sure they are up to date. 2791 // layout and make sure they are up to date.
2783 // Mac actually tests for intersection with the dirty region and tries not t o 2792 // Mac actually tests for intersection with the dirty region and tries not t o
2784 // update layout for frames that are outside the dirty region. Not only doe s this seem 2793 // update layout for frames that are outside the dirty region. Not only doe s this seem
2785 // pointless (since those frames will have set a zero timer to layout anyway ), but 2794 // pointless (since those frames will have set a zero timer to layout anyway ), but
2786 // it is also incorrect, since if two frames overlap, the first could be exc luded from the dirty 2795 // it is also incorrect, since if two frames overlap, the first could be exc luded from the dirty
2787 // region but then become included later by the second frame adding rects to the dirty region 2796 // region but then become included later by the second frame adding rects to the dirty region
2788 // when it lays out. 2797 // when it lays out.
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
3201 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation) 3210 void FrameView::willRemoveScrollbar(Scrollbar* scrollbar, ScrollbarOrientation o rientation)
3202 { 3211 {
3203 ScrollableArea::willRemoveScrollbar(scrollbar, orientation); 3212 ScrollableArea::willRemoveScrollbar(scrollbar, orientation);
3204 if (AXObjectCache* cache = axObjectCache()) { 3213 if (AXObjectCache* cache = axObjectCache()) {
3205 cache->remove(scrollbar); 3214 cache->remove(scrollbar);
3206 cache->handleScrollbarUpdate(this); 3215 cache->handleScrollbarUpdate(this);
3207 } 3216 }
3208 } 3217 }
3209 3218
3210 } // namespace WebCore 3219 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698