Backed out changeset 919a831786f1 (bug 1208638) for windows build failures

This commit is contained in:
Wes Kocher 2015-09-30 16:43:26 -07:00
Родитель 059807dbd8
Коммит eff494e681
8 изменённых файлов: 14 добавлений и 38 удалений

Просмотреть файл

@ -81,7 +81,7 @@ nsSVGPathGeometryElement::GetOrBuildPath(const DrawTarget& aDrawTarget,
{
// We only cache the path if it matches the backend used for screen painting:
bool cacheable = aDrawTarget.GetBackendType() ==
gfxPlatform::GetPlatform()->GetDefaultContentBackend();
gfxPlatform::GetPlatform()->GetContentBackend();
// Checking for and returning mCachedPath before checking the pref means
// that the pref is only live on page reload (or app restart for SVG in

Просмотреть файл

@ -74,7 +74,7 @@ BasicCompositor::BasicCompositor(nsIWidget *aWidget)
SetBackend(LayersBackend::LAYERS_BASIC);
mMaxTextureSize =
Factory::GetMaxSurfaceSize(gfxPlatform::GetPlatform()->GetContentBackendFor(LayersBackend::LAYERS_BASIC));
Factory::GetMaxSurfaceSize(gfxPlatform::GetPlatform()->GetContentBackend());
}
BasicCompositor::~BasicCompositor()

Просмотреть файл

@ -343,13 +343,13 @@ CreateBufferTextureClient(ISurfaceAllocator* aAllocator,
}
static inline gfx::BackendType
BackendTypeForBackendSelector(LayersBackend aLayersBackend, BackendSelector aSelector)
BackendTypeForBackendSelector(BackendSelector aSelector)
{
switch (aSelector) {
case BackendSelector::Canvas:
return gfxPlatform::GetPlatform()->GetPreferredCanvasBackend();
case BackendSelector::Content:
return gfxPlatform::GetPlatform()->GetContentBackendFor(aLayersBackend);
return gfxPlatform::GetPlatform()->GetContentBackend();
default:
MOZ_ASSERT_UNREACHABLE("Unknown backend selector");
return gfx::BackendType::NONE;
@ -365,8 +365,7 @@ TextureClient::CreateForDrawing(ISurfaceAllocator* aAllocator,
TextureFlags aTextureFlags,
TextureAllocationFlags aAllocFlags)
{
LayersBackend parentBackend = aAllocator->GetCompositorBackendType();
gfx::BackendType moz2DBackend = BackendTypeForBackendSelector(parentBackend, aSelector);
gfx::BackendType moz2DBackend = BackendTypeForBackendSelector(aSelector);
RefPtr<TextureClient> texture;
@ -375,6 +374,7 @@ TextureClient::CreateForDrawing(ISurfaceAllocator* aAllocator,
#endif
#ifdef XP_WIN
LayersBackend parentBackend = aAllocator->GetCompositorBackendType();
if (parentBackend == LayersBackend::LAYERS_D3D11 &&
(moz2DBackend == gfx::BackendType::DIRECT2D ||
moz2DBackend == gfx::BackendType::DIRECT2D1_1) &&
@ -407,6 +407,7 @@ TextureClient::CreateForDrawing(ISurfaceAllocator* aAllocator,
#endif
#ifdef MOZ_X11
LayersBackend parentBackend = aAllocator->GetCompositorBackendType();
gfxSurfaceType type =
gfxPlatform::GetPlatform()->ScreenReferenceSurface()->GetType();

Просмотреть файл

@ -579,8 +579,7 @@ TextureClientD3D11::AllocateForSurface(gfx::IntSize aSize, TextureAllocationFlag
// When we're not on the main thread we're not going to be using Direct2D
// to access the contents of this texture client so we will always use D3D11.
BackendType backend = windowsPlatform->GetContentBackendFor(LayersBackend::LAYERS_D3D11);
bool haveD3d11Backend = (backend == BackendType::DIRECT2D1_1) || !NS_IsMainThread();
bool haveD3d11Backend = windowsPlatform->GetContentBackend() == BackendType::DIRECT2D1_1 || !NS_IsMainThread();
if (haveD3d11Backend) {
if (!AllocateD3D11Surface(d3d11device, aSize)) {

Просмотреть файл

@ -271,16 +271,7 @@ public:
}
void GetApzSupportInfo(mozilla::widget::InfoObject& aObj);
// Get the default content backend that will be used with the default
// compositor. If the compositor is known when calling this function,
// GetContentBackendFor() should be called instead.
mozilla::gfx::BackendType GetDefaultContentBackend() {
return mContentBackend;
}
// Return the best content backend available that is compatible with the
// given layers backend.
virtual mozilla::gfx::BackendType GetContentBackendFor(mozilla::layers::LayersBackend aLayers) {
mozilla::gfx::BackendType GetContentBackend() {
return mContentBackend;
}

Просмотреть файл

@ -99,8 +99,8 @@ public:
bool UseXRender() {
#if defined(MOZ_X11)
if (GetDefaultContentBackend() != mozilla::gfx::BackendType::NONE &&
GetDefaultContentBackend() != mozilla::gfx::BackendType::CAIRO)
if (GetContentBackend() != mozilla::gfx::BackendType::NONE &&
GetContentBackend() != mozilla::gfx::BackendType::CAIRO)
return false;
return sUseXRender;

Просмотреть файл

@ -512,14 +512,12 @@ gfxWindowsPlatform::HandleDeviceReset()
return true;
}
static const BackendType SOFTWARE_BACKEND = BackendType::CAIRO;
void
gfxWindowsPlatform::UpdateBackendPrefs()
{
uint32_t canvasMask = BackendTypeBit(SOFTWARE_BACKEND);
uint32_t contentMask = BackendTypeBit(SOFTWARE_BACKEND);
BackendType defaultBackend = SOFTWARE_BACKEND;
uint32_t canvasMask = BackendTypeBit(BackendType::CAIRO);
uint32_t contentMask = BackendTypeBit(BackendType::CAIRO);
BackendType defaultBackend = BackendType::CAIRO;
if (GetD2DStatus() == FeatureStatus::Available) {
mRenderMode = RENDER_DIRECT2D;
canvasMask |= BackendTypeBit(BackendType::DIRECT2D);
@ -552,17 +550,6 @@ gfxWindowsPlatform::UpdateRenderMode()
}
}
mozilla::gfx::BackendType
gfxWindowsPlatform::GetContentBackendFor(mozilla::layers::LayersBackend aLayers)
{
if (aLayers == LayersBackend::LAYERS_D3D11) {
return gfxPlatform::GetDefaultContentBackend();
}
// If we're not accelerated with D3D11, never use D2D.
return SOFTWARE_BACKEND;
}
#ifdef CAIRO_HAS_D2D_SURFACE
HRESULT
gfxWindowsPlatform::CreateDevice(nsRefPtr<IDXGIAdapter1> &adapter1,

Просмотреть файл

@ -345,8 +345,6 @@ private:
IDXGIAdapter1 *GetDXGIAdapter();
bool IsDeviceReset(HRESULT hr, DeviceResetReason* aReason);
mozilla::gfx::BackendType GetContentBackendFor(mozilla::layers::LayersBackend aLayers) override;
#ifdef CAIRO_HAS_DWRITE_FONT
nsRefPtr<IDWriteFactory> mDWriteFactory;
nsRefPtr<IDWriteRenderingParams> mRenderingParams[TEXT_RENDERING_COUNT];