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

Side by Side Diff: sky/engine/core/frame/FrameView.cpp

Issue 892033003: Consolidate and delete a bunch of paint methods. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « sky/engine/core/frame/FrameView.h ('k') | sky/engine/core/rendering/InlineBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 // otherwise poses problems when the aggregate is not 641 // otherwise poses problems when the aggregate is not
642 // fully opaque. 642 // fully opaque.
643 if (htmlElement && htmlElement->renderer()) 643 if (htmlElement && htmlElement->renderer())
644 result = result.blend(htmlElement->renderer()->style()->colorIncludingFa llback(CSSPropertyBackgroundColor)); 644 result = result.blend(htmlElement->renderer()->style()->colorIncludingFa llback(CSSPropertyBackgroundColor));
645 645
646 return result; 646 return result;
647 } 647 }
648 648
649 void FrameView::paint(GraphicsContext* context, const IntRect& rect) 649 void FrameView::paint(GraphicsContext* context, const IntRect& rect)
650 { 650 {
651 paintContents(context, rect);
652 }
653
654 void FrameView::paintContents(GraphicsContext* p, const IntRect& rect)
655 {
656 #ifndef NDEBUG 651 #ifndef NDEBUG
657 bool fillWithRed; 652 bool fillWithRed;
658 if (isTransparent()) 653 if (isTransparent())
659 fillWithRed = false; // Transparent, don't fill with red. 654 fillWithRed = false; // Transparent, don't fill with red.
660 else 655 else
661 fillWithRed = true; 656 fillWithRed = true;
662 657
663 if (fillWithRed) 658 if (fillWithRed)
664 p->fillRect(rect, Color(0xFF, 0, 0)); 659 context->fillRect(rect, Color(0xFF, 0, 0));
665 #endif 660 #endif
666 661
667 RenderView* renderView = this->renderView(); 662 RenderView* renderView = this->renderView();
668 if (!renderView) { 663 if (!renderView) {
669 WTF_LOG_ERROR("called FrameView::paint with nil renderer"); 664 WTF_LOG_ERROR("called FrameView::paint with nil renderer");
670 return; 665 return;
671 } 666 }
672 667
673 RELEASE_ASSERT(!needsLayout()); 668 RELEASE_ASSERT(!needsLayout());
674 ASSERT(m_frame->document()->lifecycle().state() >= DocumentLifecycle::StyleA ndLayoutClean); 669 ASSERT(m_frame->document()->lifecycle().state() >= DocumentLifecycle::StyleA ndLayoutClean);
675 670
676 bool isTopLevelPainter = !s_inPaintContents; 671 bool isTopLevelPainter = !s_inPaintContents;
677 s_inPaintContents = true; 672 s_inPaintContents = true;
678 673
679 FontCachePurgePreventer fontCachePurgePreventer; 674 FontCachePurgePreventer fontCachePurgePreventer;
680 675
681 ASSERT(!m_isPainting); 676 ASSERT(!m_isPainting);
682 m_isPainting = true; 677 m_isPainting = true;
683 678
684 RenderLayer* rootLayer = renderView->layer(); 679 RenderLayer* rootLayer = renderView->layer();
685 680
686 #if ENABLE(ASSERT) 681 #if ENABLE(ASSERT)
687 renderView->assertSubtreeIsLaidOut(); 682 renderView->assertSubtreeIsLaidOut();
688 RenderObject::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(*rootLayer- >renderer()); 683 RenderObject::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(*rootLayer- >renderer());
689 #endif 684 #endif
690 685
691 rootLayer->paint(p, rect); 686 rootLayer->paint(context, rect);
692 687
693 m_isPainting = false; 688 m_isPainting = false;
694 m_lastPaintTime = currentTime(); 689 m_lastPaintTime = currentTime();
695 690
696 if (isTopLevelPainter) { 691 if (isTopLevelPainter) {
697 // Everything that happens after paintContents completions is considered 692 // Everything that happens after paintContents completions is considered
698 // to be part of the next frame. 693 // to be part of the next frame.
699 s_currentFrameTimeStamp = currentTime(); 694 s_currentFrameTimeStamp = currentTime();
700 s_inPaintContents = false; 695 s_inPaintContents = false;
701 } 696 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 totalObjects = 0; 813 totalObjects = 0;
819 814
820 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) { 815 for (RenderObject* o = root; o; o = o->nextInPreOrder(root)) {
821 ++totalObjects; 816 ++totalObjects;
822 if (o->needsLayout()) 817 if (o->needsLayout())
823 ++needsLayoutObjects; 818 ++needsLayoutObjects;
824 } 819 }
825 } 820 }
826 821
827 } // namespace blink 822 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/frame/FrameView.h ('k') | sky/engine/core/rendering/InlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698