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

Side by Side Diff: Source/core/paint/InlineFlowBoxPainter.cpp

Issue 1224893004: Turn FrameView's paintBehavior into a real global (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Improved change after the reviews. Still fails on Android. Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/FramePainter.cpp ('k') | Source/core/paint/PaintPhase.h » ('j') | 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/InlineFlowBoxPainter.h" 6 #include "core/paint/InlineFlowBoxPainter.h"
7 7
8 #include "core/layout/LayoutBlock.h" 8 #include "core/layout/LayoutBlock.h"
9 #include "core/layout/LayoutInline.h" 9 #include "core/layout/LayoutInline.h"
10 #include "core/layout/LayoutView.h" 10 #include "core/layout/LayoutView.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 LayoutRect localRect(frameRect); 284 LayoutRect localRect(frameRect);
285 m_inlineFlowBox.flipForWritingMode(localRect); 285 m_inlineFlowBox.flipForWritingMode(localRect);
286 LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); 286 LayoutPoint adjustedPaintOffset = paintOffset + localRect.location();
287 287
288 const NinePieceImage& maskNinePieceImage = m_inlineFlowBox.layoutObject().st yle()->maskBoxImage(); 288 const NinePieceImage& maskNinePieceImage = m_inlineFlowBox.layoutObject().st yle()->maskBoxImage();
289 StyleImage* maskBoxImage = m_inlineFlowBox.layoutObject().style()->maskBoxIm age().image(); 289 StyleImage* maskBoxImage = m_inlineFlowBox.layoutObject().style()->maskBoxIm age().image();
290 290
291 // Figure out if we need to push a transparency layer to render our mask. 291 // Figure out if we need to push a transparency layer to render our mask.
292 bool pushTransparencyLayer = false; 292 bool pushTransparencyLayer = false;
293 bool compositedMask = m_inlineFlowBox.layoutObject().hasLayer() && m_inlineF lowBox.boxModelObject()->layer()->hasCompositedMask(); 293 bool compositedMask = m_inlineFlowBox.layoutObject().hasLayer() && m_inlineF lowBox.boxModelObject()->layer()->hasCompositedMask();
294 bool flattenCompositingLayers = m_inlineFlowBox.layoutObject().view()->frame View() && m_inlineFlowBox.layoutObject().view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers; 294 bool flattenCompositingLayers = gGlobalPaintFlags & GlobalPaintFlattenCompos itingLayers;
295 SkXfermode::Mode compositeOp = SkXfermode::kSrcOver_Mode; 295 SkXfermode::Mode compositeOp = SkXfermode::kSrcOver_Mode;
296 if (!compositedMask || flattenCompositingLayers) { 296 if (!compositedMask || flattenCompositingLayers) {
297 if ((maskBoxImage && m_inlineFlowBox.layoutObject().style()->maskLayers( ).hasImage()) || m_inlineFlowBox.layoutObject().style()->maskLayers().next()) { 297 if ((maskBoxImage && m_inlineFlowBox.layoutObject().style()->maskLayers( ).hasImage()) || m_inlineFlowBox.layoutObject().style()->maskLayers().next()) {
298 pushTransparencyLayer = true; 298 pushTransparencyLayer = true;
299 paintInfo.context->beginLayer(1.0f, SkXfermode::kDstIn_Mode); 299 paintInfo.context->beginLayer(1.0f, SkXfermode::kDstIn_Mode);
300 } else { 300 } else {
301 // TODO(fmalita): passing a dst-in xfer mode down to paintFillLayers /paintNinePieceImage 301 // TODO(fmalita): passing a dst-in xfer mode down to paintFillLayers /paintNinePieceImage
302 // seems dangerous: it is only correct if applied atomically (sing le draw call). While 302 // seems dangerous: it is only correct if applied atomically (sing le draw call). While
303 // the heuristic above presumably ensures that is the case, this a pproach seems super 303 // the heuristic above presumably ensures that is the case, this a pproach seems super
304 // fragile. We should investigate dropping this optimization in fa vour of the more 304 // fragile. We should investigate dropping this optimization in fa vour of the more
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 rect.setHeight(logicalHeight); 354 rect.setHeight(logicalHeight);
355 } else { 355 } else {
356 rect.setX(logicalTop); 356 rect.setX(logicalTop);
357 rect.setWidth(logicalHeight); 357 rect.setWidth(logicalHeight);
358 } 358 }
359 } 359 }
360 return rect; 360 return rect;
361 } 361 }
362 362
363 } // namespace blink 363 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/FramePainter.cpp ('k') | Source/core/paint/PaintPhase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698