summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2011-05-12 08:05:27 -0700
committerAndroid Code Review <code-review@android.com>2011-05-12 08:05:27 -0700
commit555569c59ced09743507966f73d2d500c6deccec (patch)
tree4bca3a3bcdd565b833c84eb3896f280dd50e9dda
parent80aad5eedfe9e84cabb8540f818f7d1971ecadc3 (diff)
parenteac91fe693799401095de9338c877d188e8cb8ae (diff)
downloadexternal_webkit-555569c59ced09743507966f73d2d500c6deccec.zip
external_webkit-555569c59ced09743507966f73d2d500c6deccec.tar.gz
external_webkit-555569c59ced09743507966f73d2d500c6deccec.tar.bz2
Merge "Switch to SkSafeUnref for better portability"
-rw-r--r--WebCore/platform/graphics/android/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp4
-rw-r--r--WebCore/platform/graphics/android/GradientAndroid.cpp4
-rw-r--r--WebCore/platform/graphics/android/GraphicsContextAndroid.cpp4
-rw-r--r--WebCore/platform/graphics/android/LayerAndroid.cpp6
-rw-r--r--WebCore/platform/graphics/android/PatternAndroid.cpp2
-rw-r--r--WebCore/platform/graphics/chromium/FontLinux.cpp2
-rw-r--r--WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp2
-rw-r--r--WebCore/platform/graphics/skia/GradientSkia.cpp2
-rw-r--r--WebCore/platform/graphics/skia/PatternSkia.cpp2
-rw-r--r--WebCore/platform/graphics/skia/PlatformContextSkia.cpp16
-rw-r--r--WebCore/platform/graphics/skia/SkiaFontWin.cpp2
-rw-r--r--WebKit/android/jni/PictureSet.cpp8
-rw-r--r--WebKit/android/jni/WebViewCore.cpp2
-rw-r--r--WebKit/android/nav/FindCanvas.cpp6
-rw-r--r--WebKit/android/nav/SelectText.cpp4
-rw-r--r--WebKit/android/plugins/ANPTypefaceInterface.cpp2
-rw-r--r--WebKit/android/plugins/PluginWidgetAndroid.cpp4
18 files changed, 37 insertions, 37 deletions
diff --git a/WebCore/platform/graphics/android/FontCustomPlatformData.cpp b/WebCore/platform/graphics/android/FontCustomPlatformData.cpp
index d954e70..ba37ce8 100644
--- a/WebCore/platform/graphics/android/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/android/FontCustomPlatformData.cpp
@@ -41,7 +41,7 @@ FontCustomPlatformData::FontCustomPlatformData(SkTypeface* face)
FontCustomPlatformData::~FontCustomPlatformData()
{
- m_typeface->safeUnref();
+ SkSafeUnref(m_typeface);
// the unref is enough to release the font data...
}
diff --git a/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp b/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp
index 640940f..795bbe8 100644
--- a/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp
+++ b/WebCore/platform/graphics/android/FontPlatformDataAndroid.cpp
@@ -123,7 +123,7 @@ FontPlatformData::~FontPlatformData()
#endif
if (hashTableDeletedFontValue() != mTypeface) {
- mTypeface->safeUnref();
+ SkSafeUnref(mTypeface);
}
}
@@ -133,7 +133,7 @@ FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src)
src.mTypeface->safeRef();
}
if (hashTableDeletedFontValue() != mTypeface) {
- mTypeface->safeUnref();
+ SkSafeUnref(mTypeface);
}
mTypeface = src.mTypeface;
diff --git a/WebCore/platform/graphics/android/GradientAndroid.cpp b/WebCore/platform/graphics/android/GradientAndroid.cpp
index 72ae336..b8dc9dd 100644
--- a/WebCore/platform/graphics/android/GradientAndroid.cpp
+++ b/WebCore/platform/graphics/android/GradientAndroid.cpp
@@ -38,7 +38,7 @@
class PlatformGradientRec {
public:
PlatformGradientRec() : m_shader(NULL) {}
- ~PlatformGradientRec() { m_shader->safeUnref(); }
+ ~PlatformGradientRec() { SkSafeUnref(m_shader); }
SkShader* m_shader;
SkShader::TileMode m_tileMode;
@@ -102,7 +102,7 @@ SkShader* Gradient::getShader(SkShader::TileMode mode)
s = new SkColorShader(0);
// zap our previous shader, if present
- m_gradient->m_shader->safeUnref();
+ SkSafeUnref(m_gradient->m_shader);
m_gradient->m_shader = s;
m_gradient->m_tileMode = mode;
SkMatrix matrix = m_gradientSpaceTransformation;
diff --git a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
index 369dce2..6f33b19 100644
--- a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
+++ b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
@@ -121,7 +121,7 @@ public:
~State() {
delete mPath;
- mPathEffect->safeUnref();
+ SkSafeUnref(mPathEffect);
}
void setShadow(int radius, int dx, int dy, SkColor c) {
@@ -986,7 +986,7 @@ void GraphicsContext::setLineDash(const DashArray& dashes, float dashOffset)
for (unsigned int i = 0; i < count; i++)
intervals[i] = SkFloatToScalar(dashes[i % dashLength]);
SkPathEffect **effectPtr = &m_data->mState->mPathEffect;
- (*effectPtr)->safeUnref();
+ SkSafeUnref((*effectPtr));
*effectPtr = new SkDashPathEffect(intervals, count, SkFloatToScalar(dashOffset));
delete[] intervals;
diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp
index d6ba0a1..e651139 100644
--- a/WebCore/platform/graphics/android/LayerAndroid.cpp
+++ b/WebCore/platform/graphics/android/LayerAndroid.cpp
@@ -120,7 +120,7 @@ LayerAndroid::LayerAndroid(SkPicture* picture) : SkLayer(),
LayerAndroid::~LayerAndroid()
{
removeChildren();
- m_recordingPicture->safeUnref();
+ SkSafeUnref(m_recordingPicture);
m_animations.clear();
gDebugLayerAndroidInstances--;
}
@@ -375,11 +375,11 @@ bool LayerAndroid::prepareContext(bool force)
|| (m_recordingPicture
&& ((m_recordingPicture->width() != (int) getSize().width())
|| (m_recordingPicture->height() != (int) getSize().height())))) {
- m_recordingPicture->safeUnref();
+ SkSafeUnref(m_recordingPicture);
m_recordingPicture = new SkPicture();
}
} else if (m_recordingPicture) {
- m_recordingPicture->safeUnref();
+ SkSafeUnref(m_recordingPicture);
m_recordingPicture = 0;
}
diff --git a/WebCore/platform/graphics/android/PatternAndroid.cpp b/WebCore/platform/graphics/android/PatternAndroid.cpp
index 5a3fd8f..568036c 100644
--- a/WebCore/platform/graphics/android/PatternAndroid.cpp
+++ b/WebCore/platform/graphics/android/PatternAndroid.cpp
@@ -42,7 +42,7 @@ static SkShader::TileMode toTileMode(bool doRepeat) {
void Pattern::platformDestroy()
{
- m_pattern->safeUnref();
+ SkSafeUnref(m_pattern);
m_pattern = 0;
}
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index e76eca8..8bb508b 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -128,7 +128,7 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
if (textMode & cTextFill) {
// If we also filled, we don't want to draw shadows twice.
// See comment in FontChromiumWin.cpp::paintSkiaText() for more details.
- paint.setLooper(0)->safeUnref();
+ SkSafeUnref(paint.setLooper(0));
}
canvas->drawPosText(glyphs, numGlyphs << 1, pos, paint);
diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
index bf4697f..4626165 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontPlatformDataLinux.cpp
@@ -95,7 +95,7 @@ FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize)
FontPlatformData::~FontPlatformData()
{
- m_typeface->safeUnref();
+ SkSafeUnref(m_typeface);
}
FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src)
diff --git a/WebCore/platform/graphics/skia/GradientSkia.cpp b/WebCore/platform/graphics/skia/GradientSkia.cpp
index 7370a49..08cdc4a 100644
--- a/WebCore/platform/graphics/skia/GradientSkia.cpp
+++ b/WebCore/platform/graphics/skia/GradientSkia.cpp
@@ -42,7 +42,7 @@ namespace WebCore {
void Gradient::platformDestroy()
{
if (m_gradient)
- m_gradient->safeUnref();
+ SkSafeUnref(m_gradient);
m_gradient = 0;
}
diff --git a/WebCore/platform/graphics/skia/PatternSkia.cpp b/WebCore/platform/graphics/skia/PatternSkia.cpp
index bd27b6a..72fac77 100644
--- a/WebCore/platform/graphics/skia/PatternSkia.cpp
+++ b/WebCore/platform/graphics/skia/PatternSkia.cpp
@@ -42,7 +42,7 @@ namespace WebCore {
void Pattern::platformDestroy()
{
- m_pattern->safeUnref();
+ SkSafeUnref(m_pattern);
m_pattern = 0;
}
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index 92a1870..209d200 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -157,10 +157,10 @@ PlatformContextSkia::State::State(const State& other)
PlatformContextSkia::State::~State()
{
- m_looper->safeUnref();
- m_dash->safeUnref();
- m_fillShader->safeUnref();
- m_strokeShader->safeUnref();
+ SkSafeUnref(m_looper);
+ SkSafeUnref(m_dash);
+ SkSafeUnref(m_fill);
+ SkSafeUnref(m_stro);
}
SkColor PlatformContextSkia::State::applyAlpha(SkColor c) const
@@ -319,7 +319,7 @@ void PlatformContextSkia::drawRect(SkRect rect)
canvas()->drawRect(rightBorder, paint);
setFillColor(oldFillColor);
setFillShader(oldFillShader);
- oldFillShader->safeUnref();
+ SkSafeUnref(oldFillShader);
}
}
@@ -477,7 +477,7 @@ void PlatformContextSkia::setStrokeThickness(float thickness)
void PlatformContextSkia::setStrokeShader(SkShader* strokeShader)
{
if (strokeShader != m_state->m_strokeShader) {
- m_state->m_strokeShader->safeUnref();
+ SkSafeUnref(m_state->m_strokeShader);
m_state->m_strokeShader = strokeShader;
m_state->m_strokeShader->safeRef();
}
@@ -545,7 +545,7 @@ void PlatformContextSkia::setFillRule(SkPath::FillType fr)
void PlatformContextSkia::setFillShader(SkShader* fillShader)
{
if (fillShader != m_state->m_fillShader) {
- m_state->m_fillShader->safeUnref();
+ SkSafeUnref(m_state->m_fillShader);
m_state->m_fillShader = fillShader;
m_state->m_fillShader->safeRef();
}
@@ -554,7 +554,7 @@ void PlatformContextSkia::setFillShader(SkShader* fillShader)
void PlatformContextSkia::setDashPathEffect(SkDashPathEffect* dash)
{
if (dash != m_state->m_dash) {
- m_state->m_dash->safeUnref();
+ SkSafeUnref(m_state->m_dash);
m_state->m_dash = dash;
}
}
diff --git a/WebCore/platform/graphics/skia/SkiaFontWin.cpp b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
index 58fa7d3..35ceb95 100644
--- a/WebCore/platform/graphics/skia/SkiaFontWin.cpp
+++ b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
@@ -340,7 +340,7 @@ bool paintSkiaText(GraphicsContext* context,
// thing would be to draw to a new layer and then draw that layer
// with a shadow. But this is a lot of extra work for something
// that isn't normally an issue.
- paint.setLooper(0)->safeUnref();
+ SkSafeUnref(paint.setLooper(0));
}
if (!skiaDrawText(hfont, dc, platformContext->canvas(), *origin, &paint,
diff --git a/WebKit/android/jni/PictureSet.cpp b/WebKit/android/jni/PictureSet.cpp
index 55d36b4..9bd1949 100644
--- a/WebKit/android/jni/PictureSet.cpp
+++ b/WebKit/android/jni/PictureSet.cpp
@@ -150,7 +150,7 @@ bool PictureSet::build()
}
}
if (tossPicture) {
- working->mPicture->safeUnref();
+ SkSafeUnref(working->mPicture);
working->mPicture = NULL; // mark to redraw
}
if (working->mPicture == NULL) // may have been set to null elsewhere
@@ -211,7 +211,7 @@ void PictureSet::clear()
Pictures* last = mPictures.end();
for (Pictures* working = mPictures.begin(); working != last; working++) {
working->mArea.setEmpty();
- working->mPicture->safeUnref();
+ SkSafeUnref(working->mPicture);
}
mPictures.clear();
mWidth = mHeight = 0;
@@ -474,7 +474,7 @@ bool PictureSet::reuseSubdivided(const SkRegion& inval)
if ((working->mSplit == false || invalBounds != working->mUnsplit) &&
inval.contains(working->mArea) == false)
continue;
- working->mPicture->safeUnref();
+ SkSafeUnref(working->mPicture);
working->mPicture = NULL;
}
return true;
@@ -524,7 +524,7 @@ void PictureSet::setDrawTimes(const PictureSet& src)
void PictureSet::setPicture(size_t i, SkPicture* p)
{
- mPictures[i].mPicture->safeUnref();
+ SkSafeUnref(mPictures[i].mPicture);
mPictures[i].mPicture = p;
mPictures[i].mEmpty = emptyPicture(p);
}
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 3f3eb42..5c252b4 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -621,7 +621,7 @@ void WebViewCore::recordPictureSet(PictureSet* content)
DBG_SET_LOGD("{%d,%d,w=%d,h=%d}", inval.fLeft,
inval.fTop, inval.width(), inval.height());
content->add(m_addInval, picture, 0, false);
- picture->safeUnref();
+ SkSafeUnref(picture);
}
// Remove any pictures already in the set that are obscured by the new one,
// and check to see if any already split pieces need to be redrawn.
diff --git a/WebKit/android/nav/FindCanvas.cpp b/WebKit/android/nav/FindCanvas.cpp
index 15cce43..ac3deef 100644
--- a/WebKit/android/nav/FindCanvas.cpp
+++ b/WebKit/android/nav/FindCanvas.cpp
@@ -47,7 +47,7 @@ MatchInfo::MatchInfo() {
}
MatchInfo::~MatchInfo() {
- m_picture->safeUnref();
+ SkSafeUnref(m_picture);
}
MatchInfo::MatchInfo(const MatchInfo& src) {
@@ -58,7 +58,7 @@ MatchInfo::MatchInfo(const MatchInfo& src) {
}
void MatchInfo::set(const SkRegion& region, SkPicture* pic, int layerId) {
- m_picture->safeUnref();
+ SkSafeUnref(m_picture);
m_layerId = layerId;
m_location = region;
m_picture = pic;
@@ -138,7 +138,7 @@ FindCanvas::~FindCanvas() {
setBounder(NULL);
/* Just in case getAndClear was not called. */
delete mMatches;
- mWorkingPicture->safeUnref();
+ SkSafeUnref(mWorkingPicture);
}
// Each version of addMatch returns a rectangle for a match.
diff --git a/WebKit/android/nav/SelectText.cpp b/WebKit/android/nav/SelectText.cpp
index 25f9482..40bef1d 100644
--- a/WebKit/android/nav/SelectText.cpp
+++ b/WebKit/android/nav/SelectText.cpp
@@ -1268,8 +1268,8 @@ SelectText::SelectText()
paint.setShader(dropGradient);
canvas->drawRect(endDropRect, paint);
m_endControl.endRecording();
- fillGradient->safeUnref();
- dropGradient->safeUnref();
+ SkSafeUnref(fillGradient);
+ SkSafeUnref(dropGradient);
m_picture = 0;
}
diff --git a/WebKit/android/plugins/ANPTypefaceInterface.cpp b/WebKit/android/plugins/ANPTypefaceInterface.cpp
index 4b2dda2..bd50850 100644
--- a/WebKit/android/plugins/ANPTypefaceInterface.cpp
+++ b/WebKit/android/plugins/ANPTypefaceInterface.cpp
@@ -50,7 +50,7 @@ static void anp_ref(ANPTypeface* tf) {
}
static void anp_unref(ANPTypeface* tf) {
- tf->safeUnref();
+ SkSafeUnref(tf);
}
static ANPTypefaceStyle anp_getStyle(const ANPTypeface* tf) {
diff --git a/WebKit/android/plugins/PluginWidgetAndroid.cpp b/WebKit/android/plugins/PluginWidgetAndroid.cpp
index c5a1f5b..e699862 100644
--- a/WebKit/android/plugins/PluginWidgetAndroid.cpp
+++ b/WebKit/android/plugins/PluginWidgetAndroid.cpp
@@ -92,7 +92,7 @@ PluginWidgetAndroid::~PluginWidgetAndroid() {
env->DeleteGlobalRef(m_embeddedView);
}
- m_flipPixelRef->safeUnref();
+ SkSafeUnref(m_flipPixelRef);
}
void PluginWidgetAndroid::init(android::WebViewCore* core) {
@@ -128,7 +128,7 @@ void PluginWidgetAndroid::setWindow(NPWindow* window, bool isTransparent) {
layoutSurface(m_pluginBounds != oldPluginBounds);
if (m_drawingModel != kSurface_ANPDrawingModel) {
- m_flipPixelRef->safeUnref();
+ SkSafeUnref(m_flipPixelRef);
m_flipPixelRef = new SkFlipPixelRef(computeConfig(isTransparent),
window->width, window->height);
}