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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp

Issue 1422493003: Change Widget subclasses to use a CullRect instead of an IntRect for painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include "core/loader/FrameLoaderClient.h" 51 #include "core/loader/FrameLoaderClient.h"
52 #include "core/page/ChromeClient.h" 52 #include "core/page/ChromeClient.h"
53 #include "core/page/Page.h" 53 #include "core/page/Page.h"
54 #include "core/page/scrolling/ScrollingCoordinator.h" 54 #include "core/page/scrolling/ScrollingCoordinator.h"
55 #include "core/paint/FramePainter.h" 55 #include "core/paint/FramePainter.h"
56 #include "core/paint/TransformRecorder.h" 56 #include "core/paint/TransformRecorder.h"
57 #include "platform/RuntimeEnabledFeatures.h" 57 #include "platform/RuntimeEnabledFeatures.h"
58 #include "platform/ScriptForbiddenScope.h" 58 #include "platform/ScriptForbiddenScope.h"
59 #include "platform/TraceEvent.h" 59 #include "platform/TraceEvent.h"
60 #include "platform/graphics/GraphicsLayer.h" 60 #include "platform/graphics/GraphicsLayer.h"
61 #include "platform/graphics/paint/CullRect.h"
61 #include "platform/graphics/paint/DrawingRecorder.h" 62 #include "platform/graphics/paint/DrawingRecorder.h"
62 #include "platform/graphics/paint/PaintController.h" 63 #include "platform/graphics/paint/PaintController.h"
63 #include "platform/graphics/paint/TransformDisplayItem.h" 64 #include "platform/graphics/paint/TransformDisplayItem.h"
64 #include "public/platform/Platform.h" 65 #include "public/platform/Platform.h"
65 66
66 namespace blink { 67 namespace blink {
67 68
68 PaintLayerCompositor::PaintLayerCompositor(LayoutView& layoutView) 69 PaintLayerCompositor::PaintLayerCompositor(LayoutView& layoutView)
69 : m_layoutView(layoutView) 70 : m_layoutView(layoutView)
70 , m_compositingReasonFinder(layoutView) 71 , m_compositingReasonFinder(layoutView)
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 790
790 // Frame scrollbars are painted in the space of the containing frame, not th e local space of the scrollbar. 791 // Frame scrollbars are painted in the space of the containing frame, not th e local space of the scrollbar.
791 const IntPoint& paintOffset = scrollbar->frameRect().location(); 792 const IntPoint& paintOffset = scrollbar->frameRect().location();
792 IntRect transformedClip = clip; 793 IntRect transformedClip = clip;
793 transformedClip.moveBy(paintOffset); 794 transformedClip.moveBy(paintOffset);
794 795
795 AffineTransform translation; 796 AffineTransform translation;
796 translation.translate(-paintOffset.x(), -paintOffset.y()); 797 translation.translate(-paintOffset.x(), -paintOffset.y());
797 TransformRecorder transformRecorder(context, *scrollbar, translation); 798 TransformRecorder transformRecorder(context, *scrollbar, translation);
798 799
799 scrollbar->paint(&context, transformedClip); 800 scrollbar->paint(&context, CullRect(transformedClip));
800 } 801 }
801 802
802 void PaintLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, Gra phicsContext& context, GraphicsLayerPaintingPhase, const IntRect& clip) const 803 void PaintLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, Gra phicsContext& context, GraphicsLayerPaintingPhase, const IntRect& clip) const
803 { 804 {
804 if (graphicsLayer == layerForHorizontalScrollbar()) 805 if (graphicsLayer == layerForHorizontalScrollbar())
805 paintScrollbar(m_layoutView.frameView()->horizontalScrollbar(), context, clip); 806 paintScrollbar(m_layoutView.frameView()->horizontalScrollbar(), context, clip);
806 else if (graphicsLayer == layerForVerticalScrollbar()) 807 else if (graphicsLayer == layerForVerticalScrollbar())
807 paintScrollbar(m_layoutView.frameView()->verticalScrollbar(), context, c lip); 808 paintScrollbar(m_layoutView.frameView()->verticalScrollbar(), context, c lip);
808 else if (graphicsLayer == layerForScrollCorner()) 809 else if (graphicsLayer == layerForScrollCorner())
809 FramePainter(*m_layoutView.frameView()).paintScrollCorner(&context, clip ); 810 FramePainter(*m_layoutView.frameView()).paintScrollCorner(&context, clip );
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 } else if (graphicsLayer == m_scrollLayer.get()) { 1205 } else if (graphicsLayer == m_scrollLayer.get()) {
1205 name = "Frame Scrolling Layer"; 1206 name = "Frame Scrolling Layer";
1206 } else { 1207 } else {
1207 ASSERT_NOT_REACHED(); 1208 ASSERT_NOT_REACHED();
1208 } 1209 }
1209 1210
1210 return name; 1211 return name;
1211 } 1212 }
1212 1213
1213 } // namespace blink 1214 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698