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: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp

Issue 1441973003: Use recomputed interest rect only if it changed enough (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix release builds Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 IntRect transformedClip = clip; 793 IntRect transformedClip = clip;
794 transformedClip.moveBy(paintOffset); 794 transformedClip.moveBy(paintOffset);
795 795
796 AffineTransform translation; 796 AffineTransform translation;
797 translation.translate(-paintOffset.x(), -paintOffset.y()); 797 translation.translate(-paintOffset.x(), -paintOffset.y());
798 TransformRecorder transformRecorder(context, *scrollbar, translation); 798 TransformRecorder transformRecorder(context, *scrollbar, translation);
799 799
800 scrollbar->paint(&context, CullRect(transformedClip)); 800 scrollbar->paint(&context, CullRect(transformedClip));
801 } 801 }
802 802
803 void PaintLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, Gra phicsContext& context, GraphicsLayerPaintingPhase, const IntRect* clip) const 803 IntRect PaintLayerCompositor::computeInterestRect(const GraphicsLayer* graphicsL ayer, const IntRect&) const
804 { 804 {
805 IntRect defaultClip; 805 return IntRect(IntPoint(), m_layoutView.layoutSize(IncludeScrollbars));
806 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled() && !c lip) { 806 }
807 defaultClip.setSize(m_layoutView.layoutSize(IncludeScrollbars));
808 clip = &defaultClip;
809 }
810 ASSERT(clip);
811 807
808 void PaintLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, Gra phicsContext& context, GraphicsLayerPaintingPhase, const IntRect& interestRect) const
809 {
812 if (graphicsLayer == layerForHorizontalScrollbar()) 810 if (graphicsLayer == layerForHorizontalScrollbar())
813 paintScrollbar(m_layoutView.frameView()->horizontalScrollbar(), context, *clip); 811 paintScrollbar(m_layoutView.frameView()->horizontalScrollbar(), context, interestRect);
814 else if (graphicsLayer == layerForVerticalScrollbar()) 812 else if (graphicsLayer == layerForVerticalScrollbar())
815 paintScrollbar(m_layoutView.frameView()->verticalScrollbar(), context, * clip); 813 paintScrollbar(m_layoutView.frameView()->verticalScrollbar(), context, i nterestRect);
816 else if (graphicsLayer == layerForScrollCorner()) 814 else if (graphicsLayer == layerForScrollCorner())
817 FramePainter(*m_layoutView.frameView()).paintScrollCorner(&context, *cli p); 815 FramePainter(*m_layoutView.frameView()).paintScrollCorner(&context, inte restRect);
818 } 816 }
819 817
820 bool PaintLayerCompositor::supportsFixedRootBackgroundCompositing() const 818 bool PaintLayerCompositor::supportsFixedRootBackgroundCompositing() const
821 { 819 {
822 if (Settings* settings = m_layoutView.document().settings()) 820 if (Settings* settings = m_layoutView.document().settings())
823 return settings->preferCompositingToLCDTextEnabled(); 821 return settings->preferCompositingToLCDTextEnabled();
824 return false; 822 return false;
825 } 823 }
826 824
827 bool PaintLayerCompositor::needsFixedRootBackgroundLayer(const PaintLayer* layer ) const 825 bool PaintLayerCompositor::needsFixedRootBackgroundLayer(const PaintLayer* layer ) const
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 Page* PaintLayerCompositor::page() const 1175 Page* PaintLayerCompositor::page() const
1178 { 1176 {
1179 return m_layoutView.frameView()->frame().page(); 1177 return m_layoutView.frameView()->frame().page();
1180 } 1178 }
1181 1179
1182 DocumentLifecycle& PaintLayerCompositor::lifecycle() const 1180 DocumentLifecycle& PaintLayerCompositor::lifecycle() const
1183 { 1181 {
1184 return m_layoutView.document().lifecycle(); 1182 return m_layoutView.document().lifecycle();
1185 } 1183 }
1186 1184
1187 String PaintLayerCompositor::debugName(const GraphicsLayer* graphicsLayer) 1185 String PaintLayerCompositor::debugName(const GraphicsLayer* graphicsLayer) const
1188 { 1186 {
1189 String name; 1187 String name;
1190 if (graphicsLayer == m_rootContentLayer.get()) { 1188 if (graphicsLayer == m_rootContentLayer.get()) {
1191 name = "Content Root Layer"; 1189 name = "Content Root Layer";
1192 } else if (graphicsLayer == m_rootTransformLayer.get()) { 1190 } else if (graphicsLayer == m_rootTransformLayer.get()) {
1193 name = "Root Transform Layer"; 1191 name = "Root Transform Layer";
1194 } else if (graphicsLayer == m_overflowControlsHostLayer.get()) { 1192 } else if (graphicsLayer == m_overflowControlsHostLayer.get()) {
1195 name = "Frame Overflow Controls Host Layer"; 1193 name = "Frame Overflow Controls Host Layer";
1196 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) { 1194 } else if (graphicsLayer == m_layerForHorizontalScrollbar.get()) {
1197 name = "Frame Horizontal Scrollbar Layer"; 1195 name = "Frame Horizontal Scrollbar Layer";
1198 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) { 1196 } else if (graphicsLayer == m_layerForVerticalScrollbar.get()) {
1199 name = "Frame Vertical Scrollbar Layer"; 1197 name = "Frame Vertical Scrollbar Layer";
1200 } else if (graphicsLayer == m_layerForScrollCorner.get()) { 1198 } else if (graphicsLayer == m_layerForScrollCorner.get()) {
1201 name = "Frame Scroll Corner Layer"; 1199 name = "Frame Scroll Corner Layer";
1202 } else if (graphicsLayer == m_containerLayer.get()) { 1200 } else if (graphicsLayer == m_containerLayer.get()) {
1203 name = "Frame Clipping Layer"; 1201 name = "Frame Clipping Layer";
1204 } else if (graphicsLayer == m_scrollLayer.get()) { 1202 } else if (graphicsLayer == m_scrollLayer.get()) {
1205 name = "Frame Scrolling Layer"; 1203 name = "Frame Scrolling Layer";
1206 } else { 1204 } else {
1207 ASSERT_NOT_REACHED(); 1205 ASSERT_NOT_REACHED();
1208 } 1206 }
1209 1207
1210 return name; 1208 return name;
1211 } 1209 }
1212 1210
1213 } // namespace blink 1211 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698