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

Side by Side Diff: third_party/WebKit/Source/core/paint/ViewPainter.cpp

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 years 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "core/paint/ViewPainter.h" 6 #include "core/paint/ViewPainter.h"
7 7
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutBox.h" 10 #include "core/layout/LayoutBox.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // View background painting is special in the following ways: 45 // View background painting is special in the following ways:
46 // 1. The view paints background for the root element, the background positi oning respects 46 // 1. The view paints background for the root element, the background positi oning respects
47 // the positioning and transformation of the root element. 47 // the positioning and transformation of the root element.
48 // 2. CSS background-clip is ignored, the background layers always expand to cover the whole 48 // 2. CSS background-clip is ignored, the background layers always expand to cover the whole
49 // canvas. None of the stacking context effects (except transformation) o n the root element 49 // canvas. None of the stacking context effects (except transformation) o n the root element
50 // affects the background. 50 // affects the background.
51 // 3. The main frame is also responsible for painting the user-agent-defined base background 51 // 3. The main frame is also responsible for painting the user-agent-defined base background
52 // color. Conceptually it should be painted by the embedder but painting it here allows 52 // color. Conceptually it should be painted by the embedder but painting it here allows
53 // culling and pre-blending optimization when possible. 53 // culling and pre-blending optimization when possible.
54 54
55 GraphicsContext& context = *paintInfo.context; 55 GraphicsContext& context = paintInfo.context;
56 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, m_layou tView, DisplayItem::BoxDecorationBackground, LayoutPoint())) 56 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, m_layou tView, DisplayItem::BoxDecorationBackground, LayoutPoint()))
57 return; 57 return;
58 58
59 IntRect documentRect = m_layoutView.documentRect(); 59 IntRect documentRect = m_layoutView.documentRect();
60 const Document& document = m_layoutView.document(); 60 const Document& document = m_layoutView.document();
61 const FrameView& frameView = *m_layoutView.frameView(); 61 const FrameView& frameView = *m_layoutView.frameView();
62 bool isMainFrame = !document.ownerElement(); 62 bool isMainFrame = !document.ownerElement();
63 bool paintsBaseBackground = isMainFrame && !frameView.isTransparent(); 63 bool paintsBaseBackground = isMainFrame && !frameView.isTransparent();
64 bool shouldClearCanvas = paintsBaseBackground && (document.settings() && doc ument.settings()->shouldClearDocumentBackground()); 64 bool shouldClearCanvas = paintsBaseBackground && (document.settings() && doc ument.settings()->shouldClearDocumentBackground());
65 Color baseBackgroundColor = paintsBaseBackground ? frameView.baseBackgroundC olor() : Color(); 65 Color baseBackgroundColor = paintsBaseBackground ? frameView.baseBackgroundC olor() : Color();
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **it, LayoutRect(paintRect), BackgroundBleedNone); 151 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **it, LayoutRect(paintRect), BackgroundBleedNone);
152 context.restore(); 152 context.restore();
153 } 153 }
154 } 154 }
155 155
156 if (shouldDrawBackgroundInSeparateBuffer) 156 if (shouldDrawBackgroundInSeparateBuffer)
157 context.endLayer(); 157 context.endLayer();
158 } 158 }
159 159
160 } // namespace blink 160 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/VideoPainter.cpp ('k') | third_party/WebKit/Source/core/svg/graphics/SVGImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698