mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 990305 - Move IsInEmulator() from GrallocImage to gfxPlatform r=nical
This commit is contained in:
parent
2ac3bae2e0
commit
a56bfe74a2
@ -15,7 +15,6 @@
|
||||
#include "YCbCrUtils.h" // for YCbCr conversions
|
||||
|
||||
#include <ColorConverter.h>
|
||||
#include <cutils/properties.h>
|
||||
#include <OMX_IVCommon.h>
|
||||
|
||||
|
||||
@ -48,14 +47,6 @@ struct GraphicBufferAutoUnlock {
|
||||
~GraphicBufferAutoUnlock() { mGraphicBuffer->unlock(); }
|
||||
};
|
||||
|
||||
static bool
|
||||
IsInEmulator()
|
||||
{
|
||||
char propQemu[PROPERTY_VALUE_MAX];
|
||||
property_get("ro.kernel.qemu", propQemu, "");
|
||||
return !strncmp(propQemu, "1", 1);
|
||||
}
|
||||
|
||||
GrallocImage::GrallocImage()
|
||||
: PlanarYCbCrImage(nullptr)
|
||||
{
|
||||
@ -77,7 +68,7 @@ GrallocImage::SetData(const Data& aData)
|
||||
mData = aData;
|
||||
mSize = aData.mPicSize;
|
||||
|
||||
if (IsInEmulator()) {
|
||||
if (gfxPlatform::GetPlatform()->IsInGonkEmulator()) {
|
||||
// Emulator does not support HAL_PIXEL_FORMAT_YV12.
|
||||
return;
|
||||
}
|
||||
|
@ -26,6 +26,10 @@
|
||||
#include "AndroidBridge.h"
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
#include <cutils/properties.h>
|
||||
#endif
|
||||
|
||||
#include "ft2build.h"
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_MODULE_H
|
||||
@ -129,6 +133,11 @@ gfxAndroidPlatform::gfxAndroidPlatform()
|
||||
mOffscreenFormat = gfxImageFormat::RGB16_565;
|
||||
}
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
char propQemu[PROPERTY_VALUE_MAX];
|
||||
property_get("ro.kernel.qemu", propQemu, "");
|
||||
mIsInGonkEmulator = !strncmp(propQemu, "1", 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
gfxAndroidPlatform::~gfxAndroidPlatform()
|
||||
|
@ -80,9 +80,17 @@ public:
|
||||
|
||||
virtual bool UseAcceleratedSkiaCanvas() MOZ_OVERRIDE;
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
virtual bool IsInGonkEmulator() const { return mIsInGonkEmulator; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
int mScreenDepth;
|
||||
gfxImageFormat mOffscreenFormat;
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
bool mIsInGonkEmulator;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* GFX_PLATFORM_ANDROID_H */
|
||||
|
@ -591,6 +591,8 @@ public:
|
||||
mozilla::gl::SkiaGLGlue* GetSkiaGLGlue();
|
||||
void PurgeSkiaCache();
|
||||
|
||||
virtual bool IsInGonkEmulator() const { return false; }
|
||||
|
||||
protected:
|
||||
gfxPlatform();
|
||||
virtual ~gfxPlatform();
|
||||
|
Loading…
Reference in New Issue
Block a user