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

Unified Diff: Source/core/html/canvas/CanvasStyle.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: Smaller adjustments Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/CanvasStyle.cpp
diff --git a/Source/core/html/canvas/CanvasStyle.cpp b/Source/core/html/canvas/CanvasStyle.cpp
index 788a2345e8e49f0acf3c93ff1c28dcd501541b06..36d4961849a4cb0329d276377c94a22962f73447 100644
--- a/Source/core/html/canvas/CanvasStyle.cpp
+++ b/Source/core/html/canvas/CanvasStyle.cpp
@@ -112,28 +112,28 @@ CanvasStyle::CanvasStyle(float c, float m, float y, float k, float a)
{
}
-CanvasStyle::CanvasStyle(PassRefPtr<CanvasGradient> gradient)
+CanvasStyle::CanvasStyle(PassRefPtrWillBeRawPtr<CanvasGradient> gradient)
: m_type(Gradient)
, m_gradient(gradient)
{
}
-CanvasStyle::CanvasStyle(PassRefPtr<CanvasPattern> pattern)
+CanvasStyle::CanvasStyle(PassRefPtrWillBeRawPtr<CanvasPattern> pattern)
: m_type(ImagePattern)
, m_pattern(pattern)
{
}
-PassRefPtr<CanvasStyle> CanvasStyle::createFromString(const String& color)
+PassRefPtrWillBeRawPtr<CanvasStyle> CanvasStyle::createFromString(const String& color)
{
RGBA32 rgba;
ColorParseResult parseResult = parseColor(rgba, color);
switch (parseResult) {
case ParsedRGBA:
case ParsedSystemColor:
- return adoptRef(new CanvasStyle(rgba));
+ return adoptRefWillBeNoop(new CanvasStyle(rgba));
case ParsedCurrentColor:
- return adoptRef(new CanvasStyle(CurrentColor));
+ return adoptRefWillBeNoop(new CanvasStyle(CurrentColor));
case ParseFailed:
return nullptr;
default:
@@ -142,15 +142,15 @@ PassRefPtr<CanvasStyle> CanvasStyle::createFromString(const String& color)
}
}
-PassRefPtr<CanvasStyle> CanvasStyle::createFromStringWithOverrideAlpha(const String& color, float alpha)
+PassRefPtrWillBeRawPtr<CanvasStyle> CanvasStyle::createFromStringWithOverrideAlpha(const String& color, float alpha)
{
RGBA32 rgba;
ColorParseResult parseResult = parseColor(rgba, color);
switch (parseResult) {
case ParsedRGBA:
- return adoptRef(new CanvasStyle(colorWithOverrideAlpha(rgba, alpha)));
+ return adoptRefWillBeNoop(new CanvasStyle(colorWithOverrideAlpha(rgba, alpha)));
case ParsedCurrentColor:
- return adoptRef(new CanvasStyle(CurrentColorWithOverrideAlpha, alpha));
+ return adoptRefWillBeNoop(new CanvasStyle(CurrentColorWithOverrideAlpha, alpha));
case ParseFailed:
return nullptr;
default:
@@ -159,18 +159,18 @@ PassRefPtr<CanvasStyle> CanvasStyle::createFromStringWithOverrideAlpha(const Str
}
}
-PassRefPtr<CanvasStyle> CanvasStyle::createFromGradient(PassRefPtr<CanvasGradient> gradient)
+PassRefPtrWillBeRawPtr<CanvasStyle> CanvasStyle::createFromGradient(PassRefPtrWillBeRawPtr<CanvasGradient> gradient)
{
if (!gradient)
return nullptr;
- return adoptRef(new CanvasStyle(gradient));
+ return adoptRefWillBeNoop(new CanvasStyle(gradient));
}
-PassRefPtr<CanvasStyle> CanvasStyle::createFromPattern(PassRefPtr<CanvasPattern> pattern)
+PassRefPtrWillBeRawPtr<CanvasStyle> CanvasStyle::createFromPattern(PassRefPtrWillBeRawPtr<CanvasPattern> pattern)
{
if (!pattern)
return nullptr;
- return adoptRef(new CanvasStyle(pattern));
+ return adoptRefWillBeNoop(new CanvasStyle(pattern));
}
bool CanvasStyle::isEquivalentColor(const CanvasStyle& other) const
@@ -272,4 +272,10 @@ void CanvasStyle::applyFillColor(GraphicsContext* context)
}
}
+void CanvasStyle::trace(Visitor* visitor)
+{
+ visitor->trace(m_gradient);
+ visitor->trace(m_pattern);
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698