Bug 959380 - 3/5 - Make gfxSurfaceType a typed enum - r=jrmuizel

find . -type f | grep -v '\./obj' | grep -v '\.hg' | xargs sed -i 's/\(^\|[^A-Za-z0-9_]\)gfxSurfaceType\(Image\|PDF\|PS\|Xlib\|Xcb\|Glitz\|Quartz\|Win32\|BeOS\|DirectFB\|SVG\|OS2\|Win32Printing\|QuartzImage\|Script\|QPainter\|Recording\|VG\|GL\|DRM\|Tee\|XML\|Skia\|Subsurface\|D2D\|Max\)\($\|[^A-Za-z0-9_]\)/\1gfxSurfaceType::\2\3/g'
This commit is contained in:
Benoit Jacob
2014-01-23 13:26:40 -05:00
parent 844232d97c
commit 2bd34eb690
28 changed files with 102 additions and 102 deletions

View File

@@ -137,7 +137,7 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface)
#endif
, mAccumulatedInvalidRect(0,0,0,0)
, mIsTransparent(false)
, mSurfaceType(gfxSurfaceTypeMax)
, mSurfaceType(gfxSurfaceType::Max)
, mCurrentInvalidateTask(nullptr)
, mCurrentAsyncSetWindowTask(nullptr)
, mPendingPluginCall(false)
@@ -2773,7 +2773,7 @@ GfxFromNsRect(const nsIntRect& aRect)
bool
PluginInstanceChild::CreateOptSurface(void)
{
NS_ABORT_IF_FALSE(mSurfaceType != gfxSurfaceTypeMax,
NS_ABORT_IF_FALSE(mSurfaceType != gfxSurfaceType::Max,
"Need a valid surface type here");
NS_ASSERTION(!mCurrentSurface, "mCurrentSurfaceActor can get out of sync.");
@@ -2792,7 +2792,7 @@ PluginInstanceChild::CreateOptSurface(void)
format = gfxImageFormat::RGB16_565;
}
if (mSurfaceType == gfxSurfaceTypeXlib) {
if (mSurfaceType == gfxSurfaceType::Xlib) {
if (!mIsTransparent || mBackground) {
Visual* defaultVisual = DefaultVisualOfScreen(screen);
mCurrentSurface =
@@ -2816,8 +2816,8 @@ PluginInstanceChild::CreateOptSurface(void)
#endif
#ifdef XP_WIN
if (mSurfaceType == gfxSurfaceTypeWin32 ||
mSurfaceType == gfxSurfaceTypeD2D) {
if (mSurfaceType == gfxSurfaceType::Win32 ||
mSurfaceType == gfxSurfaceType::D2D) {
bool willHaveTransparentPixels = mIsTransparent && !mBackground;
SharedDIBSurface* s = new SharedDIBSurface();
@@ -2856,7 +2856,7 @@ PluginInstanceChild::MaybeCreatePlatformHelperSurface(void)
mDoAlphaExtraction = false;
bool createHelperSurface = false;
if (mCurrentSurface->GetType() == gfxSurfaceTypeXlib) {
if (mCurrentSurface->GetType() == gfxSurfaceType::Xlib) {
static_cast<gfxXlibSurface*>(mCurrentSurface.get())->
GetColormapAndVisual(&colormap, &visual);
// Create helper surface if layer surface visual not same as default
@@ -2866,7 +2866,7 @@ PluginInstanceChild::MaybeCreatePlatformHelperSurface(void)
visual = defaultVisual;
mDoAlphaExtraction = mIsTransparent;
}
} else if (mCurrentSurface->GetType() == gfxSurfaceTypeImage) {
} else if (mCurrentSurface->GetType() == gfxSurfaceType::Image) {
// For image layer surface we should always create helper surface
createHelperSurface = true;
// Check if we can create helper surface with non-default visual
@@ -3014,7 +3014,7 @@ PluginInstanceChild::UpdateWindowAttributes(bool aForceSetWindow)
#ifdef MOZ_X11
Visual* visual = nullptr;
Colormap colormap = 0;
if (curSurface && curSurface->GetType() == gfxSurfaceTypeXlib) {
if (curSurface && curSurface->GetType() == gfxSurfaceType::Xlib) {
static_cast<gfxXlibSurface*>(curSurface.get())->
GetColormapAndVisual(&colormap, &visual);
if (visual != mWsInfo.visual || colormap != mWsInfo.colormap) {
@@ -3106,7 +3106,7 @@ PluginInstanceChild::PaintRectToPlatformSurface(const nsIntRect& aRect,
#ifdef MOZ_X11
{
NS_ASSERTION(aSurface->GetType() == gfxSurfaceTypeXlib,
NS_ASSERTION(aSurface->GetType() == gfxSurfaceType::Xlib,
"Non supported platform surface type");
NPEvent pluginEvent;
@@ -3208,7 +3208,7 @@ PluginInstanceChild::PaintRectWithAlphaExtraction(const nsIntRect& aRect,
// recovered directly to it, do that to save a tmp surface and
// copy.
bool useSurfaceSubimageForBlack = false;
if (gfxSurfaceTypeImage == aSurface->GetType()) {
if (gfxSurfaceType::Image == aSurface->GetType()) {
gfxImageSurface* surfaceAsImage =
static_cast<gfxImageSurface*>(aSurface);
useSurfaceSubimageForBlack =
@@ -3484,7 +3484,7 @@ PluginInstanceChild::ShowPluginFrame()
(uint16_t)rect.YMost(), (uint16_t)rect.XMost() };
SurfaceDescriptor currSurf;
#ifdef MOZ_X11
if (mCurrentSurface->GetType() == gfxSurfaceTypeXlib) {
if (mCurrentSurface->GetType() == gfxSurfaceType::Xlib) {
gfxXlibSurface *xsurf = static_cast<gfxXlibSurface*>(mCurrentSurface.get());
currSurf = SurfaceDescriptorX11(xsurf);
// Need to sync all pending x-paint requests
@@ -3536,7 +3536,7 @@ PluginInstanceChild::ReadbackDifferenceRect(const nsIntRect& rect)
// We can read safely from XSurface,SharedDIBSurface and Unsafe SharedMemory,
// because PluginHost is not able to modify that surface
#if defined(MOZ_X11)
if (mBackSurface->GetType() != gfxSurfaceTypeXlib &&
if (mBackSurface->GetType() != gfxSurfaceType::Xlib &&
!gfxSharedImageSurface::IsSharedImage(mBackSurface))
return false;
#elif defined(XP_WIN)