mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1025537 - Stop using gfxImageSurface in gfxBlur and gfxPlatform::CreateDrawTargetForData. r=mattwoodrow
This commit is contained in:
parent
9207dbc8c0
commit
8954b72140
@ -5,7 +5,6 @@
|
||||
|
||||
#include "gfxBlur.h"
|
||||
#include "gfxContext.h"
|
||||
#include "gfxImageSurface.h"
|
||||
#include "gfxPlatform.h"
|
||||
|
||||
#include "mozilla/gfx/Blur.h"
|
||||
@ -70,15 +69,7 @@ gfxAlphaBoxBlur::Init(const gfxRect& aRect,
|
||||
mBlur->GetStride(),
|
||||
SurfaceFormat::A8);
|
||||
if (!dt) {
|
||||
nsRefPtr<gfxImageSurface> image =
|
||||
new gfxImageSurface(mData,
|
||||
gfxIntSize(size.width, size.height),
|
||||
mBlur->GetStride(),
|
||||
gfxImageFormat::A8);
|
||||
dt = Factory::CreateDrawTargetForCairoSurface(image->CairoSurface(), size);
|
||||
if (!dt) {
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IntRect irect = mBlur->GetRect();
|
||||
|
@ -1018,11 +1018,18 @@ TemporaryRef<DrawTarget>
|
||||
gfxPlatform::CreateDrawTargetForData(unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat)
|
||||
{
|
||||
NS_ASSERTION(mContentBackend != BackendType::NONE, "No backend.");
|
||||
if (mContentBackend == BackendType::CAIRO) {
|
||||
nsRefPtr<gfxImageSurface> image = new gfxImageSurface(aData, gfxIntSize(aSize.width, aSize.height), aStride, SurfaceFormatToImageFormat(aFormat));
|
||||
return Factory::CreateDrawTargetForCairoSurface(image->CairoSurface(), aSize);
|
||||
|
||||
RefPtr<DrawTarget> dt = Factory::CreateDrawTargetForData(mContentBackend,
|
||||
aData, aSize,
|
||||
aStride, aFormat);
|
||||
if (!dt) {
|
||||
// Factory::CreateDrawTargetForData does not support mContentBackend; retry
|
||||
// with BackendType::CAIRO:
|
||||
dt = Factory::CreateDrawTargetForData(BackendType::CAIRO,
|
||||
aData, aSize,
|
||||
aStride, aFormat);
|
||||
}
|
||||
return Factory::CreateDrawTargetForData(mContentBackend, aData, aSize, aStride, aFormat);
|
||||
return dt.forget();
|
||||
}
|
||||
|
||||
/* static */ BackendType
|
||||
|
Loading…
Reference in New Issue
Block a user