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

Unified Diff: Source/core/paint/BoxPainter.cpp

Issue 744163002: Enable fast/images with slimming paint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix compile Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/paint/BoxPainter.cpp
diff --git a/Source/core/paint/BoxPainter.cpp b/Source/core/paint/BoxPainter.cpp
index 152cb6cc691fe1f2aec53d1e0f06ff40e6458c91..99926941043325b46783c8d48194132fb2eb90e7 100644
--- a/Source/core/paint/BoxPainter.cpp
+++ b/Source/core/paint/BoxPainter.cpp
@@ -11,6 +11,7 @@
#include "core/paint/BackgroundImageGeometry.h"
#include "core/paint/BoxDecorationData.h"
#include "core/paint/DrawingRecorder.h"
+#include "core/paint/TransparencyDisplayItem.h"
#include "core/rendering/ImageQualityController.h"
#include "core/rendering/PaintInfo.h"
#include "core/rendering/RenderBox.h"
@@ -515,7 +516,7 @@ void BoxPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint& paintO
void BoxPainter::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& paintRect)
{
// Figure out if we need to push a transparency layer to render our mask.
- bool pushTransparencyLayer = false;
+ OwnPtr<TransparencyRecorder> transparencyRecorder;
bool compositedMask = m_renderBox.hasLayer() && m_renderBox.layer()->hasCompositedMask();
bool flattenCompositingLayers = m_renderBox.view()->frameView() && m_renderBox.view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers;
CompositeOperator compositeOp = CompositeSourceOver;
@@ -523,7 +524,6 @@ void BoxPainter::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& p
bool allMaskImagesLoaded = true;
if (!compositedMask || flattenCompositingLayers) {
- pushTransparencyLayer = true;
StyleImage* maskBoxImage = m_renderBox.style()->maskBoxImage().image();
const FillLayer& maskLayers = m_renderBox.style()->maskLayers();
@@ -534,7 +534,9 @@ void BoxPainter::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& p
allMaskImagesLoaded &= maskLayers.imagesAreLoaded();
paintInfo.context->setCompositeOperation(CompositeDestinationIn);
- paintInfo.context->beginTransparencyLayer(1);
+
+ transparencyRecorder = adoptPtr(new TransparencyRecorder(paintInfo.context, &m_renderBox, DisplayItem::BeginTransparency, WebBlendModeNormal, 1));
chrishtr 2014/11/26 17:20:59 On reflection, I think this was maybe wrong. The o
+
compositeOp = CompositeSourceOver;
}
@@ -542,9 +544,6 @@ void BoxPainter::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& p
paintFillLayers(paintInfo, Color::transparent, m_renderBox.style()->maskLayers(), paintRect, BackgroundBleedNone, compositeOp);
paintNinePieceImage(m_renderBox, paintInfo.context, paintRect, m_renderBox.style(), m_renderBox.style()->maskBoxImage(), compositeOp);
}
-
- if (pushTransparencyLayer)
- paintInfo.context->endLayer();
}
void BoxPainter::paintClippingMask(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)

Powered by Google App Engine
This is Rietveld 408576698