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

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

Issue 1527343002: Simplify paintFillLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 if (combinedBackgroundColor.alpha()) 135 if (combinedBackgroundColor.alpha())
136 context.fillRect(documentRect, combinedBackgroundColor, (shouldDrawBackg roundInSeparateBuffer || shouldClearCanvas) ? SkXfermode::kSrc_Mode : SkXfermode ::kSrcOver_Mode); 136 context.fillRect(documentRect, combinedBackgroundColor, (shouldDrawBackg roundInSeparateBuffer || shouldClearCanvas) ? SkXfermode::kSrc_Mode : SkXfermode ::kSrcOver_Mode);
137 else if (shouldClearCanvas && !shouldDrawBackgroundInSeparateBuffer) 137 else if (shouldClearCanvas && !shouldDrawBackgroundInSeparateBuffer)
138 context.fillRect(documentRect, Color(), SkXfermode::kClear_Mode); 138 context.fillRect(documentRect, Color(), SkXfermode::kClear_Mode);
139 139
140 for (auto it = reversedPaintList.rbegin(); it != reversedPaintList.rend(); + +it) { 140 for (auto it = reversedPaintList.rbegin(); it != reversedPaintList.rend(); + +it) {
141 ASSERT((*it)->clip() == BorderFillBox); 141 ASSERT((*it)->clip() == BorderFillBox);
142 142
143 bool shouldPaintInViewportSpace = (*it)->attachment() == FixedBackground Attachment; 143 bool shouldPaintInViewportSpace = (*it)->attachment() == FixedBackground Attachment;
144 if (shouldPaintInViewportSpace) { 144 if (shouldPaintInViewportSpace) {
145 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **it, LayoutRect(LayoutRect::infiniteIntRect()), BackgroundBleedNone); 145 BoxPainter::paintFillLayer(m_layoutView, paintInfo, Color(), **it, L ayoutRect(LayoutRect::infiniteIntRect()), BackgroundBleedNone);
146 } else { 146 } else {
147 context.save(); 147 context.save();
148 // TODO(trchen): We should be able to handle 3D-transformed root 148 // TODO(trchen): We should be able to handle 3D-transformed root
149 // background with slimming paint by using transform display items. 149 // background with slimming paint by using transform display items.
150 context.concatCTM(transform.toAffineTransform()); 150 context.concatCTM(transform.toAffineTransform());
151 BoxPainter::paintFillLayerExtended(m_layoutView, paintInfo, Color(), **it, LayoutRect(paintRect), BackgroundBleedNone); 151 BoxPainter::paintFillLayer(m_layoutView, paintInfo, Color(), **it, L ayoutRect(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/InlineTextBoxPainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698