зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1264120. Remove usage of nsAutoPtr from gfx/src. r=jfkthame
This commit is contained in:
Родитель
0905089f9b
Коммит
6e3873d9c3
|
@ -16,7 +16,7 @@
|
|||
#include "mozilla/Services.h" // for GetObserverService
|
||||
#include "mozilla/StaticMutex.h"
|
||||
#include "mozilla/mozalloc.h" // for operator new, etc
|
||||
#include "nsAutoPtr.h" // for nsRefPtr
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "nsCOMPtr.h" // for nsCOMPtr
|
||||
#include "nsError.h" // for NS_OK, NS_FAILED, nsresult
|
||||
#include "nsExceptionHandler.h" // for AppendAppNotesToCrashReport
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "gfxTypes.h" // for gfxFloat
|
||||
#include "gfxFont.h" // for gfxFont::Orientation
|
||||
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
|
||||
#include "nsAutoPtr.h" // for nsRefPtr
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "nsCOMPtr.h" // for nsCOMPtr
|
||||
#include "nsCoord.h" // for nscoord
|
||||
#include "nsError.h" // for nsresult
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <sys/types.h> // for int16_t
|
||||
#include "gfxFontFamilyList.h"
|
||||
#include "gfxFontFeatures.h"
|
||||
#include "nsAutoPtr.h" // for nsRefPtr
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "nsCoord.h" // for nscoord
|
||||
#include "nsStringFwd.h" // for nsSubstring
|
||||
#include "nsString.h" // for nsString
|
||||
|
|
|
@ -20,8 +20,10 @@
|
|||
#include "nsString.h" // for nsString
|
||||
#include "nsStyleConsts.h" // for NS_STYLE_HYPHENS_NONE
|
||||
#include "mozilla/Assertions.h" // for MOZ_ASSERT
|
||||
#include "mozilla/UniquePtr.h" // for UniquePtr
|
||||
|
||||
class gfxUserFontSet;
|
||||
using namespace mozilla;
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -32,27 +34,27 @@ public:
|
|||
AutoTextRun(nsFontMetrics* aMetrics, DrawTarget* aDrawTarget,
|
||||
const char* aString, int32_t aLength)
|
||||
{
|
||||
mTextRun = aMetrics->GetThebesFontGroup()->MakeTextRun(
|
||||
mTextRun.reset(aMetrics->GetThebesFontGroup()->MakeTextRun(
|
||||
reinterpret_cast<const uint8_t*>(aString), aLength,
|
||||
aDrawTarget,
|
||||
aMetrics->AppUnitsPerDevPixel(),
|
||||
ComputeFlags(aMetrics),
|
||||
nullptr);
|
||||
nullptr));
|
||||
}
|
||||
|
||||
AutoTextRun(nsFontMetrics* aMetrics, DrawTarget* aDrawTarget,
|
||||
const char16_t* aString, int32_t aLength)
|
||||
{
|
||||
mTextRun = aMetrics->GetThebesFontGroup()->MakeTextRun(
|
||||
mTextRun.reset(aMetrics->GetThebesFontGroup()->MakeTextRun(
|
||||
aString, aLength,
|
||||
aDrawTarget,
|
||||
aMetrics->AppUnitsPerDevPixel(),
|
||||
ComputeFlags(aMetrics),
|
||||
nullptr);
|
||||
nullptr));
|
||||
}
|
||||
|
||||
gfxTextRun *get() { return mTextRun; }
|
||||
gfxTextRun *operator->() { return mTextRun; }
|
||||
gfxTextRun *get() { return mTextRun.get(); }
|
||||
gfxTextRun *operator->() { return mTextRun.get(); }
|
||||
|
||||
private:
|
||||
static uint32_t ComputeFlags(nsFontMetrics* aMetrics) {
|
||||
|
@ -76,7 +78,7 @@ private:
|
|||
return flags;
|
||||
}
|
||||
|
||||
nsAutoPtr<gfxTextRun> mTextRun;
|
||||
UniquePtr<gfxTextRun> mTextRun;
|
||||
};
|
||||
|
||||
class StubPropertyProvider : public gfxTextRun::PropertyProvider {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <sys/types.h> // for int32_t
|
||||
#include "gfxTextRun.h" // for gfxFont, gfxFontGroup
|
||||
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
|
||||
#include "nsAutoPtr.h" // for nsRefPtr
|
||||
#include "mozilla/RefPtr.h" // for RefPtr
|
||||
#include "nsCOMPtr.h" // for nsCOMPtr
|
||||
#include "nsCoord.h" // for nscoord
|
||||
#include "nsError.h" // for nsresult
|
||||
|
|
Загрузка…
Ссылка в новой задаче