зеркало из https://github.com/mozilla/gecko-dev.git
Use StPortSetter from the nsGfxUtils.h header. r=pinkerton
This commit is contained in:
Родитель
e35432ce72
Коммит
e3042083ab
|
@ -34,7 +34,9 @@
|
||||||
#include "nsTransform2D.h"
|
#include "nsTransform2D.h"
|
||||||
#include "nsVoidArray.h"
|
#include "nsVoidArray.h"
|
||||||
#include "nsGfxCIID.h"
|
#include "nsGfxCIID.h"
|
||||||
|
#include "nsGfxUtils.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
#include "plhash.h"
|
#include "plhash.h"
|
||||||
|
|
||||||
#include <FixMath.h>
|
#include <FixMath.h>
|
||||||
|
@ -45,30 +47,6 @@
|
||||||
#define STACK_TREASHOLD 1000
|
#define STACK_TREASHOLD 1000
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
// utility port setting class
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class StPortSetter {
|
|
||||||
public:
|
|
||||||
StPortSetter(GrafPtr newPort)
|
|
||||||
: mNewPort(newPort), mOldPort(::GetQDGlobalsThePort())
|
|
||||||
{
|
|
||||||
if (mOldPort != newPort)
|
|
||||||
::SetPort(newPort);
|
|
||||||
}
|
|
||||||
|
|
||||||
~StPortSetter()
|
|
||||||
{
|
|
||||||
if (mOldPort != mNewPort)
|
|
||||||
::SetPort(mOldPort);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
GrafPtr mNewPort;
|
|
||||||
GrafPtr mOldPort;
|
|
||||||
};
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
|
|
||||||
nsRenderingContextMac::nsRenderingContextMac()
|
nsRenderingContextMac::nsRenderingContextMac()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче