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

Unified Diff: Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 1297383003: Keep TextMetrics on the Oilpan heap always. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « Source/modules/canvas2d/CanvasRenderingContext2D.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/canvas2d/CanvasRenderingContext2D.cpp
diff --git a/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
index 4e3e06d2f42195553adec4d946b0c6b8eb677e55..3a8f02cade7fa95c9427b100016c312f6522ff4a 100644
--- a/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
+++ b/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -1893,13 +1893,13 @@ void CanvasRenderingContext2D::strokeText(const String& text, float x, float y,
drawTextInternal(text, x, y, CanvasRenderingContext2DState::StrokePaintType, &maxWidth);
}
-PassRefPtrWillBeRawPtr<TextMetrics> CanvasRenderingContext2D::measureText(const String& text)
+TextMetrics* CanvasRenderingContext2D::measureText(const String& text)
{
- RefPtrWillBeRawPtr<TextMetrics> metrics = TextMetrics::create();
+ TextMetrics* metrics = TextMetrics::create();
// The style resolution required for rendering text is not available in frame-less documents.
if (!canvas()->document().frame())
- return metrics.release();
+ return metrics;
canvas()->document().updateLayoutTreeForNodeIfNeeded(canvas());
const Font& font = accessFont();
@@ -1937,7 +1937,7 @@ PassRefPtrWillBeRawPtr<TextMetrics> CanvasRenderingContext2D::measureText(const
metrics->setHangingBaseline(-0.8f * ascent + baselineY);
metrics->setAlphabeticBaseline(baselineY);
metrics->setIdeographicBaseline(descent + baselineY);
- return metrics.release();
+ return metrics;
}
void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, float y, CanvasRenderingContext2DState::PaintType paintType, float* maxWidth)
« no previous file with comments | « Source/modules/canvas2d/CanvasRenderingContext2D.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698