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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 365653002: Oilpan: move 2D Canvas and WebGL objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Round of improvements Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index dd4f26b00cb987f9b894c1118bf662bae8301e4b..78564a89258043a138d8bde00f161fa14970f14f 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -348,6 +348,13 @@ void CanvasRenderingContext2D::State::fontsNeedUpdate(CSSFontSelector* fontSelec
m_font.update(fontSelector);
}
+void CanvasRenderingContext2D::State::trace(Visitor* visitor)
+{
+ visitor->trace(m_strokeStyle);
+ visitor->trace(m_fillStyle);
+ CSSFontSelectorClient::trace(visitor);
+}
+
void CanvasRenderingContext2D::realizeSaves()
{
validateStateStack();
@@ -394,9 +401,9 @@ CanvasStyle* CanvasRenderingContext2D::strokeStyle() const
return state().m_strokeStyle.get();
}
-void CanvasRenderingContext2D::setStrokeStyle(PassRefPtr<CanvasStyle> prpStyle)
+void CanvasRenderingContext2D::setStrokeStyle(PassRefPtrWillBeRawPtr<CanvasStyle> prpStyle)
{
- RefPtr<CanvasStyle> style = prpStyle;
+ RefPtrWillBeRawPtr<CanvasStyle> style = prpStyle;
if (!style)
return;
@@ -427,9 +434,9 @@ CanvasStyle* CanvasRenderingContext2D::fillStyle() const
return state().m_fillStyle.get();
}
-void CanvasRenderingContext2D::setFillStyle(PassRefPtr<CanvasStyle> prpStyle)
+void CanvasRenderingContext2D::setFillStyle(PassRefPtrWillBeRawPtr<CanvasStyle> prpStyle)
{
- RefPtr<CanvasStyle> style = prpStyle;
+ RefPtrWillBeRawPtr<CanvasStyle> style = prpStyle;
if (!style)
return;
@@ -1655,24 +1662,24 @@ template<class T> void CanvasRenderingContext2D::fullCanvasCompositedStroke(cons
c->endLayer();
}
-PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createLinearGradient(float x0, float y0, float x1, float y1)
+PassRefPtrWillBeRawPtr<CanvasGradient> CanvasRenderingContext2D::createLinearGradient(float x0, float y0, float x1, float y1)
{
- RefPtr<CanvasGradient> gradient = CanvasGradient::create(FloatPoint(x0, y0), FloatPoint(x1, y1));
+ RefPtrWillBeRawPtr<CanvasGradient> gradient = CanvasGradient::create(FloatPoint(x0, y0), FloatPoint(x1, y1));
return gradient.release();
}
-PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionState& exceptionState)
+PassRefPtrWillBeRawPtr<CanvasGradient> CanvasRenderingContext2D::createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionState& exceptionState)
{
if (r0 < 0 || r1 < 0) {
exceptionState.throwDOMException(IndexSizeError, String::format("The %s provided is less than 0.", r0 < 0 ? "r0" : "r1"));
return nullptr;
}
- RefPtr<CanvasGradient> gradient = CanvasGradient::create(FloatPoint(x0, y0), r0, FloatPoint(x1, y1), r1);
+ RefPtrWillBeRawPtr<CanvasGradient> gradient = CanvasGradient::create(FloatPoint(x0, y0), r0, FloatPoint(x1, y1), r1);
return gradient.release();
}
-PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(CanvasImageSource* imageSource,
+PassRefPtrWillBeRawPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(CanvasImageSource* imageSource,
const String& repetitionType, ExceptionState& exceptionState)
{
bool repeatX, repeatY;
@@ -2062,9 +2069,9 @@ static String normalizeSpaces(const String& text)
return String(charVector);
}
-PassRefPtr<TextMetrics> CanvasRenderingContext2D::measureText(const String& text)
+PassRefPtrWillBeRawPtr<TextMetrics> CanvasRenderingContext2D::measureText(const String& text)
{
- RefPtr<TextMetrics> metrics = TextMetrics::create();
+ RefPtrWillBeRawPtr<TextMetrics> metrics = TextMetrics::create();
// The style resolution required for rendering text is not available in frame-less documents.
if (!canvas()->document().frame())
@@ -2286,9 +2293,9 @@ void CanvasRenderingContext2D::setImageSmoothingEnabled(bool enabled)
c->setImageInterpolationQuality(enabled ? CanvasDefaultInterpolationQuality : InterpolationNone);
}
-PassRefPtr<Canvas2DContextAttributes> CanvasRenderingContext2D::getContextAttributes() const
+PassRefPtrWillBeRawPtr<Canvas2DContextAttributes> CanvasRenderingContext2D::getContextAttributes() const
{
- RefPtr<Canvas2DContextAttributes> attributes = Canvas2DContextAttributes::create();
+ RefPtrWillBeRawPtr<Canvas2DContextAttributes> attributes = Canvas2DContextAttributes::create();
attributes->setAlpha(m_hasAlpha);
return attributes.release();
}

Powered by Google App Engine
This is Rietveld 408576698