WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-152932-20160108152801.patch (text/plain), 25.63 KB, created by
Simon Fraser (smfr)
on 2016-01-08 15:28:33 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2016-01-08 15:28:33 PST
Size:
25.63 KB
patch
obsolete
>Subversion Revision: 194798 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a90cb39bff902e98cf34d557949772dc5193f7ef..426df621caeec83eb1b745cdfdd251ff6cfd4033 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,78 @@ > 2016-01-08 Simon Fraser <simon.fraser@apple.com> > >+ Add DisplayList hooks into GraphicsContext >+ https://bugs.webkit.org/show_bug.cgi?id=152932 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add the hooks into GraphicsContext that call into the DisplayListRecorder if there >+ is one. >+ >+ Rename size() to something less ambiguous. >+ >+ Out-of-line some DisplayList functions so that the header doesn't need to see >+ DisplayListItems.h. >+ >+ * platform/graphics/GraphicsContext.cpp: >+ (WebCore::GraphicsContext::save): >+ (WebCore::GraphicsContext::restore): >+ (WebCore::GraphicsContext::setStrokeThickness): >+ (WebCore::GraphicsContext::setStrokeStyle): >+ (WebCore::GraphicsContext::setStrokeColor): >+ (WebCore::GraphicsContext::setShadow): >+ (WebCore::GraphicsContext::setLegacyShadow): >+ (WebCore::GraphicsContext::clearShadow): >+ (WebCore::GraphicsContext::setFillColor): >+ (WebCore::GraphicsContext::setShadowsIgnoreTransforms): >+ (WebCore::GraphicsContext::setShouldAntialias): >+ (WebCore::GraphicsContext::setShouldSmoothFonts): >+ (WebCore::GraphicsContext::setShouldSubpixelQuantizeFonts): >+ (WebCore::GraphicsContext::setImageInterpolationQuality): >+ (WebCore::GraphicsContext::setAntialiasedFontDilationEnabled): >+ (WebCore::GraphicsContext::setStrokePattern): >+ (WebCore::GraphicsContext::setFillPattern): >+ (WebCore::GraphicsContext::setStrokeGradient): >+ (WebCore::GraphicsContext::setFillRule): >+ (WebCore::GraphicsContext::setFillGradient): >+ (WebCore::GraphicsContext::beginTransparencyLayer): >+ (WebCore::GraphicsContext::endTransparencyLayer): >+ (WebCore::GraphicsContext::drawGlyphs): >+ (WebCore::GraphicsContext::drawImage): >+ (WebCore::GraphicsContext::drawTiledImage): >+ (WebCore::GraphicsContext::setTextDrawingMode): >+ (WebCore::GraphicsContext::fillRect): >+ (WebCore::GraphicsContext::fillRoundedRect): >+ (WebCore::GraphicsContext::setAlpha): >+ (WebCore::GraphicsContext::setCompositeOperation): >+ (WebCore::GraphicsContext::setDrawLuminanceMask): >+ (WebCore::GraphicsContext::applyDeviceScaleFactor): >+ (WebCore::GraphicsContext::applyState): >+ * platform/graphics/GraphicsContext.h: >+ (WebCore::GraphicsContext::setDisplayListRecorder): >+ (WebCore::GraphicsContext::isRecording): >+ (WebCore::GraphicsContext::setFillRule): Deleted. >+ (WebCore::GraphicsContext::setShadowsIgnoreTransforms): Deleted. >+ (WebCore::GraphicsContext::setShouldSubpixelQuantizeFonts): Deleted. >+ (WebCore::GraphicsContext::setDrawLuminanceMask): Deleted. >+ * platform/graphics/displaylists/DisplayList.cpp: >+ (WebCore::DisplayList::DisplayList::clear): >+ (WebCore::DisplayList::DisplayList::removeItemsFromIndex): >+ * platform/graphics/displaylists/DisplayList.h: >+ (WebCore::DisplayList::DisplayList::itemCount): >+ (WebCore::DisplayList::DisplayList::clear): Deleted. >+ (WebCore::DisplayList::DisplayList::size): Deleted. >+ (WebCore::DisplayList::DisplayList::removeItemsFromIndex): Deleted. >+ * platform/graphics/displaylists/DisplayListRecorder.cpp: >+ (WebCore::DisplayList::Recorder::save): >+ (WebCore::DisplayList::Recorder::restore): >+ * platform/graphics/displaylists/DisplayListRecorder.h: >+ (WebCore::DisplayList::Recorder::itemCount): >+ (WebCore::DisplayList::Recorder::size): Deleted. >+ * platform/graphics/displaylists/DisplayListReplayer.cpp: >+ (WebCore::DisplayList::Replayer::replay): >+ >+2016-01-08 Simon Fraser <simon.fraser@apple.com> >+ > Consider painting to be disabled on a GraphicsContext with no platform data, and make updatingControlTints() immutable state > https://bugs.webkit.org/show_bug.cgi?id=152927 > >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.cpp b/Source/WebCore/platform/graphics/GraphicsContext.cpp >index d988ebb4b038de0fd21f97decf371c14f54d7337..529d6eff7fe6766ecacc1b696edaf75e845927cb 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.cpp >+++ b/Source/WebCore/platform/graphics/GraphicsContext.cpp >@@ -28,6 +28,7 @@ > > #include "BidiResolver.h" > #include "BitmapImage.h" >+#include "DisplayListRecorder.h" > #include "FloatRoundedRect.h" > #include "Gradient.h" > #include "ImageBuffer.h" >@@ -383,6 +384,11 @@ void GraphicsContext::save() > > m_stack.append(m_state); > >+ if (isRecording()) { >+ m_displayListRecorder->save(); >+ return; >+ } >+ > savePlatformState(); > } > >@@ -403,6 +409,11 @@ void GraphicsContext::restore() > if (m_stack.isEmpty()) > m_stack.clear(); > >+ if (isRecording()) { >+ m_displayListRecorder->restore(); >+ return; >+ } >+ > restorePlatformState(); > } > >@@ -429,12 +440,21 @@ void GraphicsContext::drawRaisedEllipse(const FloatRect& rect, const Color& elli > void GraphicsContext::setStrokeThickness(float thickness) > { > m_state.strokeThickness = thickness; >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::StrokeThicknessChange); >+ return; >+ } >+ > setPlatformStrokeThickness(thickness); > } > > void GraphicsContext::setStrokeStyle(StrokeStyle style) > { > m_state.strokeStyle = style; >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::StrokeStyleChange); >+ return; >+ } > setPlatformStrokeStyle(style); > } > >@@ -443,6 +463,10 @@ void GraphicsContext::setStrokeColor(const Color& color) > m_state.strokeColor = color; > m_state.strokeGradient = nullptr; > m_state.strokePattern = nullptr; >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::StrokeColorChange); >+ return; >+ } > setPlatformStrokeColor(color); > } > >@@ -451,6 +475,13 @@ void GraphicsContext::setShadow(const FloatSize& offset, float blur, const Color > m_state.shadowOffset = offset; > m_state.shadowBlur = blur; > m_state.shadowColor = color; >+#if USE(CG) >+ m_state.shadowsUseLegacyRadius = false; >+#endif >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::ShadowChange); >+ return; >+ } > setPlatformShadow(offset, blur, color); > } > >@@ -462,6 +493,10 @@ void GraphicsContext::setLegacyShadow(const FloatSize& offset, float blur, const > #if USE(CG) > m_state.shadowsUseLegacyRadius = true; > #endif >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::ShadowChange); >+ return; >+ } > setPlatformShadow(offset, blur, color); > } > >@@ -470,6 +505,14 @@ void GraphicsContext::clearShadow() > m_state.shadowOffset = FloatSize(); > m_state.shadowBlur = 0; > m_state.shadowColor = Color(); >+#if USE(CG) >+ m_state.shadowsUseLegacyRadius = false; >+#endif >+ >+ if (isRecording()) { >+ m_displayListRecorder->clearShadow(); >+ return; >+ } > clearPlatformShadow(); > } > >@@ -505,21 +548,53 @@ void GraphicsContext::setFillColor(const Color& color) > m_state.fillColor = color; > m_state.fillGradient = nullptr; > m_state.fillPattern = nullptr; >+ >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::FillColorChange); >+ return; >+ } >+ > setPlatformFillColor(color); > } > >+void GraphicsContext::setShadowsIgnoreTransforms(bool shadowsIgnoreTransforms) >+{ >+ m_state.shadowsIgnoreTransforms = shadowsIgnoreTransforms; >+ if (isRecording()) >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::ShadowsIgnoreTransformsChange); >+} >+ > void GraphicsContext::setShouldAntialias(bool shouldAntialias) > { > m_state.shouldAntialias = shouldAntialias; >+ >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::ShouldAntialiasChange); >+ return; >+ } >+ > setPlatformShouldAntialias(shouldAntialias); > } > > void GraphicsContext::setShouldSmoothFonts(bool shouldSmoothFonts) > { > m_state.shouldSmoothFonts = shouldSmoothFonts; >+ >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::ShouldSmoothFontsChange); >+ return; >+ } >+ > setPlatformShouldSmoothFonts(shouldSmoothFonts); > } > >+void GraphicsContext::setShouldSubpixelQuantizeFonts(bool shouldSubpixelQuantizeFonts) >+{ >+ m_state.shouldSubpixelQuantizeFonts = shouldSubpixelQuantizeFonts; >+ if (isRecording()) >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::ShouldSubpixelQuantizeFontsChange); >+} >+ > void GraphicsContext::setImageInterpolationQuality(InterpolationQuality imageInterpolationQuality) > { > m_state.imageInterpolationQuality = imageInterpolationQuality; >@@ -527,46 +602,76 @@ void GraphicsContext::setImageInterpolationQuality(InterpolationQuality imageInt > if (paintingDisabled()) > return; > >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::ImageInterpolationQualityChange); >+ return; >+ } >+ > setPlatformImageInterpolationQuality(imageInterpolationQuality); > } > > void GraphicsContext::setAntialiasedFontDilationEnabled(bool antialiasedFontDilationEnabled) > { > m_state.antialiasedFontDilationEnabled = antialiasedFontDilationEnabled; >+ if (isRecording()) >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::AntialiasedFontDilationEnabledChange); > } > > void GraphicsContext::setStrokePattern(Ref<Pattern>&& pattern) > { > m_state.strokeGradient = nullptr; > m_state.strokePattern = WTFMove(pattern); >+ if (isRecording()) >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::StrokePatternChange); > } > > void GraphicsContext::setFillPattern(Ref<Pattern>&& pattern) > { > m_state.fillGradient = nullptr; > m_state.fillPattern = WTFMove(pattern); >+ if (isRecording()) >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::FillPatternChange); > } > > void GraphicsContext::setStrokeGradient(Ref<Gradient>&& gradient) > { > m_state.strokeGradient = WTFMove(gradient); > m_state.strokePattern = nullptr; >+ if (isRecording()) >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::StrokeGradientChange); >+} >+ >+void GraphicsContext::setFillRule(WindRule fillRule) >+{ >+ m_state.fillRule = fillRule; >+ if (isRecording()) >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::FillRuleChange); > } > > void GraphicsContext::setFillGradient(Ref<Gradient>&& gradient) > { > m_state.fillGradient = WTFMove(gradient); > m_state.fillPattern = nullptr; >+ if (isRecording()) >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::FillGradientChange); // FIXME: also fill pattern? > } > > void GraphicsContext::beginTransparencyLayer(float opacity) > { >+ if (isRecording()) { >+ m_displayListRecorder->beginTransparencyLayer(opacity); >+ return; >+ } > beginPlatformTransparencyLayer(opacity); > ++m_transparencyCount; > } > > void GraphicsContext::endTransparencyLayer() > { >+ if (isRecording()) { >+ m_displayListRecorder->endTransparencyLayer(); >+ return; >+ } > endPlatformTransparencyLayer(); > ASSERT(m_transparencyCount > 0); > --m_transparencyCount; >@@ -585,6 +690,11 @@ void GraphicsContext::drawGlyphs(const FontCascade& fontCascade, const Font& fon > if (paintingDisabled()) > return; > >+ if (isRecording()) { >+ m_displayListRecorder->drawGlyphs(font, buffer, from, numGlyphs, point, fontCascade.fontDescription().fontSmoothing()); >+ return; >+ } >+ > fontCascade.drawGlyphs(*this, font, buffer, from, numGlyphs, point); > } > >@@ -651,6 +761,11 @@ void GraphicsContext::drawImage(Image& image, const FloatRect& destination, cons > if (paintingDisabled()) > return; > >+ if (isRecording()) { >+ m_displayListRecorder->drawImage(image, destination, source, imagePaintingOptions); >+ return; >+ } >+ > // FIXME (49002): Should be InterpolationLow > InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationNone : imageInterpolationQuality()); > image.draw(*this, destination, source, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode, imagePaintingOptions.m_orientationDescription); >@@ -661,6 +776,11 @@ void GraphicsContext::drawTiledImage(Image& image, const FloatRect& destination, > if (paintingDisabled()) > return; > >+ if (isRecording()) { >+ m_displayListRecorder->drawTiledImage(image, destination, source, tileSize, spacing, imagePaintingOptions); >+ return; >+ } >+ > InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationLow : imageInterpolationQuality()); > image.drawTiled(*this, destination, source, tileSize, spacing, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode); > } >@@ -671,6 +791,11 @@ void GraphicsContext::drawTiledImage(Image& image, const FloatRect& destination, > if (paintingDisabled()) > return; > >+ if (isRecording()) { >+ m_displayListRecorder->drawTiledImage(image, destination, source, tileScaleFactor, hRule, vRule, imagePaintingOptions); >+ return; >+ } >+ > if (hRule == Image::StretchTile && vRule == Image::StretchTile) { > // Just do a scale. > drawImage(image, destination, source, imagePaintingOptions); >@@ -766,6 +891,11 @@ void GraphicsContext::setTextDrawingMode(TextDrawingModeFlags mode) > m_state.textDrawingMode = mode; > if (paintingDisabled()) > return; >+ >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::TextDrawingModeChange); >+ return; >+ } > setPlatformTextDrawingMode(mode); > } > >@@ -773,6 +903,12 @@ void GraphicsContext::fillRect(const FloatRect& rect, Gradient& gradient) > { > if (paintingDisabled()) > return; >+ >+ if (isRecording()) { >+ m_displayListRecorder->fillRect(rect, gradient); >+ return; >+ } >+ > gradient.fill(this, rect); > } > >@@ -781,6 +917,11 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, Compos > if (paintingDisabled()) > return; > >+ if (isRecording()) { >+ m_displayListRecorder->fillRect(rect, color, op, blendMode); >+ return; >+ } >+ > CompositeOperator previousOperator = compositeOperation(); > setCompositeOperation(op, blendMode); > fillRect(rect, color); >@@ -792,6 +933,11 @@ void GraphicsContext::fillRoundedRect(const FloatRoundedRect& rect, const Color& > if (paintingDisabled()) > return; > >+ if (isRecording()) { >+ m_displayListRecorder->fillRoundedRect(rect, color, blendMode); >+ return; >+ } >+ > if (rect.isRounded()) { > setCompositeOperation(compositeOperation(), blendMode); > platformFillRoundedRect(rect, color); >@@ -830,6 +976,10 @@ void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const FloatRo > void GraphicsContext::setAlpha(float alpha) > { > m_state.alpha = alpha; >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::AlphaChange); >+ return; >+ } > setPlatformAlpha(alpha); > } > >@@ -837,9 +987,20 @@ void GraphicsContext::setCompositeOperation(CompositeOperator compositeOperation > { > m_state.compositeOperator = compositeOperation; > m_state.blendMode = blendMode; >+ if (isRecording()) { >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::CompositeOperationChange); >+ return; >+ } > setPlatformCompositeOperation(compositeOperation, blendMode); > } > >+void GraphicsContext::setDrawLuminanceMask(bool drawLuminanceMask) >+{ >+ m_state.drawLuminanceMask = drawLuminanceMask; >+ if (isRecording()) >+ m_displayListRecorder->updateState(m_state, GraphicsContextState::DrawLuminanceMaskChange); >+} >+ > #if !USE(CG) > // Implement this if you want to go push the drawing mode into your native context immediately. > void GraphicsContext::setPlatformTextDrawingMode(TextDrawingModeFlags) >@@ -934,6 +1095,12 @@ void GraphicsContext::platformApplyDeviceScaleFactor(float) > void GraphicsContext::applyDeviceScaleFactor(float deviceScaleFactor) > { > scale(FloatSize(deviceScaleFactor, deviceScaleFactor)); >+ >+ if (isRecording()) { >+ m_displayListRecorder->applyDeviceScaleFactor(deviceScaleFactor); >+ return; >+ } >+ > platformApplyDeviceScaleFactor(deviceScaleFactor); > } > >@@ -1013,4 +1180,18 @@ FloatRect GraphicsContext::computeLineBoundsAndAntialiasingModeForText(const Flo > return FloatRect(origin, FloatSize(width, thickness)); > } > >+void GraphicsContext::applyState(const GraphicsContextState& state) >+{ >+ setPlatformShadow(state.shadowOffset, state.shadowBlur, state.shadowColor); >+ setPlatformStrokeThickness(state.strokeThickness); >+ setPlatformTextDrawingMode(state.textDrawingMode); >+ setPlatformStrokeColor(state.strokeColor); >+ setPlatformFillColor(state.fillColor); >+ setPlatformStrokeStyle(state.strokeStyle); >+ setPlatformAlpha(state.alpha); >+ setPlatformCompositeOperation(state.compositeOperator, state.blendMode); >+ setPlatformShouldAntialias(state.shouldAntialias); >+ setPlatformShouldSmoothFonts(state.shouldSmoothFonts); >+} >+ > } >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.h b/Source/WebCore/platform/graphics/GraphicsContext.h >index 5640c250d679a1df26a5da63b6f30ab4d442a085..e6377b80d97f4cce1923e34e1f187ef54d0b1ca6 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.h >+++ b/Source/WebCore/platform/graphics/GraphicsContext.h >@@ -110,6 +110,10 @@ enum InterpolationQuality { > InterpolationHigh > }; > >+namespace DisplayList { >+class Recorder; >+} >+ > struct GraphicsContextState { > GraphicsContextState() > : shouldAntialias(true) >@@ -246,6 +250,7 @@ class GraphicsContext { > WTF_MAKE_NONCOPYABLE(GraphicsContext); WTF_MAKE_FAST_ALLOCATED; > public: > WEBCORE_EXPORT GraphicsContext(PlatformGraphicsContext*); >+ GraphicsContext() = default; > WEBCORE_EXPORT ~GraphicsContext(); > > enum class NonPaintingReasons { >@@ -256,9 +261,12 @@ public: > > WEBCORE_EXPORT PlatformGraphicsContext* platformContext() const; > >- bool paintingDisabled() const { return !m_data; } >+ bool paintingDisabled() const { return !m_data && !isRecording(); } > bool updatingControlTints() const { return m_nonPaintingReasons == NonPaintingReasons::UpdatingControlTints; } > >+ void setDisplayListRecorder(DisplayList::Recorder* recorder) { m_displayListRecorder = recorder; } >+ bool isRecording() const { return m_displayListRecorder; } >+ > void setStrokeThickness(float); > float strokeThickness() const { return m_state.strokeThickness; } > >@@ -274,7 +282,7 @@ public: > void setStrokeGradient(Ref<Gradient>&&); > Gradient* strokeGradient() const { return m_state.strokeGradient.get(); } > >- void setFillRule(WindRule fillRule) { m_state.fillRule = fillRule; } >+ void setFillRule(WindRule); > WindRule fillRule() const { return m_state.fillRule; } > > WEBCORE_EXPORT void setFillColor(const Color&); >@@ -286,7 +294,7 @@ public: > WEBCORE_EXPORT void setFillGradient(Ref<Gradient>&&); > Gradient* fillGradient() const { return m_state.fillGradient.get(); } > >- void setShadowsIgnoreTransforms(bool shadowsIgnoreTransforms) { m_state.shadowsIgnoreTransforms = shadowsIgnoreTransforms; } >+ void setShadowsIgnoreTransforms(bool); > bool shadowsIgnoreTransforms() const { return m_state.shadowsIgnoreTransforms; } > > WEBCORE_EXPORT void setShouldAntialias(bool); >@@ -300,7 +308,7 @@ public: > > // Normally CG enables subpixel-quantization because it improves the performance of aligning glyphs. > // In some cases we have to disable to to ensure a high-quality output of the glyphs. >- void setShouldSubpixelQuantizeFonts(bool shouldSubpixelQuantizeFonts) { m_state.shouldSubpixelQuantizeFonts = shouldSubpixelQuantizeFonts; } >+ void setShouldSubpixelQuantizeFonts(bool); > bool shouldSubpixelQuantizeFonts() const { return m_state.shouldSubpixelQuantizeFonts; } > > const GraphicsContextState& state() const { return m_state; } >@@ -393,6 +401,8 @@ public: > void drawEmphasisMarks(const FontCascade&, const TextRun& , const AtomicString& mark, const FloatPoint&, int from = 0, int to = -1); > void drawBidiText(const FontCascade&, const TextRun&, const FloatPoint&, FontCascade::CustomFontNotReadyAction = FontCascade::DoNotPaintIfFontNotReady); > >+ void applyState(const GraphicsContextState&); >+ > enum RoundingMode { > RoundAllSides, > RoundOriginAndDimensions >@@ -452,7 +462,7 @@ public: > CompositeOperator compositeOperation() const { return m_state.compositeOperator; } > BlendMode blendModeOperation() const { return m_state.blendMode; } > >- void setDrawLuminanceMask(bool drawLuminanceMask) { m_state.drawLuminanceMask = drawLuminanceMask; } >+ void setDrawLuminanceMask(bool); > bool drawLuminanceMask() const { return m_state.drawLuminanceMask; } > > // This clip function is used only by <canvas> code. It allows >@@ -602,6 +612,7 @@ private: > FloatRect computeLineBoundsAndAntialiasingModeForText(const FloatPoint&, float width, bool printing, Color&); > > GraphicsContextPlatformPrivate* m_data { nullptr }; >+ DisplayList::Recorder* m_displayListRecorder { nullptr }; > > GraphicsContextState m_state; > Vector<GraphicsContextState, 1> m_stack; >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp >index 79bfdcd70939f46626077f492ae6bfe6e095fb66..fb9fd3095cd9540365fd82badeccff6e32d112ec 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayList.cpp >@@ -48,6 +48,16 @@ void DisplayList::dump() const > } > #endif > >+void DisplayList::clear() >+{ >+ m_list.clear(); >+} >+ >+void DisplayList::removeItemsFromIndex(size_t index) >+{ >+ m_list.resize(index); >+} >+ > void DisplayList::dump(TextStream& ts) const > { > TextStream::GroupScope group(ts); >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayList.h b/Source/WebCore/platform/graphics/displaylists/DisplayList.h >index 69536d2970b0f1bc6e23ab6f559e9da1c06e14f6..1e1813f90735cf1f583710af85284883dda6e0c1 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayList.h >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayList.h >@@ -58,14 +58,10 @@ public: > return m_list[index].get(); > } > >- void clear() { m_list.clear(); } >- size_t size() const { return m_list.size(); } >- >- void removeItemsFromIndex(size_t index) >- { >- m_list.resize(index); >- } >+ void clear(); >+ void removeItemsFromIndex(size_t); > >+ size_t itemCount() const { return m_list.size(); } > size_t sizeInBytes() const; > > #if !defined(NDEBUG) || !LOG_DISABLED >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >index 5afc10365de12f889926f507dce941ae2361d2f4..789a846f8d9268895678871a3ee80916f655142a 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >@@ -143,7 +143,7 @@ void Recorder::drawPattern(Image& image, const FloatRect& tileRect, const Affine > void Recorder::save() > { > appendItem(Save::create()); >- m_stateStack.append(m_stateStack.last().cloneForSave(m_displayList.size() - 1)); >+ m_stateStack.append(m_stateStack.last().cloneForSave(m_displayList.itemCount() - 1)); > } > > void Recorder::restore() >@@ -168,7 +168,7 @@ void Recorder::restore() > > if (saveIndex) { > Save& saveItem = downcast<Save>(m_displayList.itemAt(saveIndex)); >- saveItem.setRestoreIndex(m_displayList.size() - 1); >+ saveItem.setRestoreIndex(m_displayList.itemCount() - 1); > } > } > >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h >index a0ab8b9f96033c200992662272daa7a1436943f2..2f36a3f8035eda6d8cd8c68bac494efd99084759 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h >@@ -120,7 +120,7 @@ public: > > void applyDeviceScaleFactor(float); > >- size_t size() const { return m_displayList.size(); } >+ size_t itemCount() const { return m_displayList.itemCount(); } > > private: > Item& appendItem(Ref<Item>&&); >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListReplayer.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListReplayer.cpp >index 83017b04d2d36c3d40b860faf7404779199b41bf..2080d8197879b7950e3f107c195953db4443b797 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListReplayer.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListReplayer.cpp >@@ -50,7 +50,7 @@ void Replayer::replay(const FloatRect& initialClip) > LOG_WITH_STREAM(DisplayLists, stream << "\nReplaying with clip " << initialClip); > UNUSED_PARAM(initialClip); > >- size_t numItems = m_displayList.size(); >+ size_t numItems = m_displayList.itemCount(); > for (size_t i = 0; i < numItems; ++i) { > auto& item = m_displayList.list()[i].get(); > LOG_WITH_STREAM(DisplayLists, stream << "drawing " << i << " " << item);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
zalan
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 152932
:
268593
| 268594