mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge m-c to inbound.
This commit is contained in:
commit
2edb5862a5
@ -12,8 +12,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b88eb63c3950ecaa88d00399735e52d83ab6e307"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6894b915ee7d031a1f0ed16c422c48f293de1b84"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="022eadd5917615ff00c47eaaafa792b45e9c8a28"/>
|
||||
|
@ -11,8 +11,8 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="b88eb63c3950ecaa88d00399735e52d83ab6e307"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="6894b915ee7d031a1f0ed16c422c48f293de1b84"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="905bfa3548eb75cf1792d0d8412b92113bbd4318"/>
|
||||
@ -122,9 +122,9 @@
|
||||
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
|
||||
<project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="09485b73629856b21b2ed6073e327ab0e69a1189"/>
|
||||
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="8f7c9ac889ae2c778197b4a4c0529d60530f480b"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="594cef96f1e5353f41dc75c4e8b586b1dd980f49"/>
|
||||
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2838a77ce4b8c09fa6a46fe25410bb3a4474cbd4"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="72e3a520e3c700839f07ba0113fd527b923c3330"/>
|
||||
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="c283f635d537f3fb249813028702577be50fdcef"/>
|
||||
<project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
|
||||
</manifest>
|
||||
|
@ -12,8 +12,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b88eb63c3950ecaa88d00399735e52d83ab6e307"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6894b915ee7d031a1f0ed16c422c48f293de1b84"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="022eadd5917615ff00c47eaaafa792b45e9c8a28"/>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"revision": "5ef18673926479e25a67e4133256f11dea0cf88e",
|
||||
"revision": "5b157e823d42532a365d33cfe3a8bd9ba4b71152",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -11,8 +11,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b88eb63c3950ecaa88d00399735e52d83ab6e307"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6894b915ee7d031a1f0ed16c422c48f293de1b84"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
|
||||
|
@ -10,8 +10,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b88eb63c3950ecaa88d00399735e52d83ab6e307"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6894b915ee7d031a1f0ed16c422c48f293de1b84"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
|
||||
|
@ -12,8 +12,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b88eb63c3950ecaa88d00399735e52d83ab6e307"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6894b915ee7d031a1f0ed16c422c48f293de1b84"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
|
||||
|
@ -11,8 +11,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b88eb63c3950ecaa88d00399735e52d83ab6e307"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6894b915ee7d031a1f0ed16c422c48f293de1b84"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
|
||||
|
@ -11,8 +11,8 @@
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="b88eb63c3950ecaa88d00399735e52d83ab6e307"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="6894b915ee7d031a1f0ed16c422c48f293de1b84"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="a314508e397c8f1814228d36259ea8708034444e"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="905bfa3548eb75cf1792d0d8412b92113bbd4318"/>
|
||||
|
@ -11,8 +11,8 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b88eb63c3950ecaa88d00399735e52d83ab6e307"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="78b908b493bfe0b477e3d4f6edec8c46a2c0d096"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6894b915ee7d031a1f0ed16c422c48f293de1b84"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="15e8982284c4560f9c74c2b9fe8bb361ebfe0cb6"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="3d5c964015967ca8c86abe6dbbebee3cb82b1609"/>
|
||||
|
@ -8,7 +8,6 @@
|
||||
#endif
|
||||
#include "prlog.h"
|
||||
|
||||
#include "gfxPlatform.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsClipboard.h"
|
||||
#include "nsString.h"
|
||||
@ -25,10 +24,6 @@
|
||||
#include "imgIContainer.h"
|
||||
#include "nsCocoaUtils.h"
|
||||
|
||||
using mozilla::gfx::DataSourceSurface;
|
||||
using mozilla::gfx::SourceSurface;
|
||||
using mozilla::RefPtr;
|
||||
|
||||
// Screenshots use the (undocumented) png pasteboard type.
|
||||
#define IMAGE_PASTEBOARD_TYPES NSTIFFPboardType, @"Apple PNG pasteboard type", nil
|
||||
|
||||
@ -436,20 +431,18 @@ nsClipboard::PasteboardDictFromTransferable(nsITransferable* aTransferable)
|
||||
continue;
|
||||
}
|
||||
|
||||
nsRefPtr<gfxASurface> thebesSurface =
|
||||
nsRefPtr<gfxASurface> surface =
|
||||
image->GetFrame(imgIContainer::FRAME_CURRENT,
|
||||
imgIContainer::FLAG_SYNC_DECODE);
|
||||
if (!thebesSurface) {
|
||||
continue;
|
||||
}
|
||||
RefPtr<SourceSurface> surface =
|
||||
gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(
|
||||
gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget(), thebesSurface);
|
||||
if (!surface) {
|
||||
continue;
|
||||
}
|
||||
nsRefPtr<gfxImageSurface> frame(surface->GetAsReadableARGB32ImageSurface());
|
||||
if (!frame) {
|
||||
continue;
|
||||
}
|
||||
CGImageRef imageRef = NULL;
|
||||
nsresult rv = nsCocoaUtils::CreateCGImageFromSurface(surface, &imageRef);
|
||||
nsresult rv = nsCocoaUtils::CreateCGImageFromSurface(frame, &imageRef);
|
||||
if (NS_FAILED(rv) || !imageRef) {
|
||||
continue;
|
||||
}
|
||||
|
@ -26,12 +26,6 @@
|
||||
|
||||
class nsIWidget;
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
class SourceSurface;
|
||||
}
|
||||
}
|
||||
|
||||
// Used to retain a Cocoa object for the remainder of a method's execution.
|
||||
class nsAutoRetainCocoaObject {
|
||||
public:
|
||||
@ -108,9 +102,7 @@ struct KeyBindingsCommand
|
||||
|
||||
class nsCocoaUtils
|
||||
{
|
||||
typedef mozilla::gfx::SourceSurface SourceSurface;
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
// Get the backing scale factor from an object that supports this selector
|
||||
// (NSView/Window/Screen, on 10.7 or later), returning 1.0 if not supported
|
||||
@ -234,8 +226,7 @@ public:
|
||||
@param aResult the resulting CGImageRef
|
||||
@return NS_OK if the conversion worked, NS_ERROR_FAILURE otherwise
|
||||
*/
|
||||
static nsresult CreateCGImageFromSurface(SourceSurface* aSurface,
|
||||
CGImageRef* aResult);
|
||||
static nsresult CreateCGImageFromSurface(gfxImageSurface *aFrame, CGImageRef *aResult);
|
||||
|
||||
/** Creates a Cocoa <code>NSImage</code> from a <code>CGImageRef</code>.
|
||||
Copies the pixel data from the <code>CGImageRef</code> into a new <code>NSImage</code>.
|
||||
|
@ -4,7 +4,6 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "gfxImageSurface.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "nsCocoaUtils.h"
|
||||
#include "nsChildView.h"
|
||||
#include "nsMenuBarX.h"
|
||||
@ -18,7 +17,6 @@
|
||||
#include "nsMenuUtilsX.h"
|
||||
#include "nsToolkit.h"
|
||||
#include "nsCRT.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/MiscEvents.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
@ -26,11 +24,6 @@
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::widget;
|
||||
|
||||
using mozilla::gfx::DataSourceSurface;
|
||||
using mozilla::gfx::IntSize;
|
||||
using mozilla::gfx::SurfaceFormat;
|
||||
using mozilla::gfx::SourceSurface;
|
||||
|
||||
static float
|
||||
MenuBarScreenHeight()
|
||||
{
|
||||
@ -265,46 +258,29 @@ void nsCocoaUtils::CleanUpAfterNativeAppModalDialog()
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
void data_ss_release_callback(void *aDataSourceSurface,
|
||||
const void *data,
|
||||
size_t size)
|
||||
nsresult nsCocoaUtils::CreateCGImageFromSurface(gfxImageSurface *aFrame, CGImageRef *aResult)
|
||||
{
|
||||
if (aDataSourceSurface) {
|
||||
static_cast<DataSourceSurface*>(aDataSourceSurface)->Release();
|
||||
}
|
||||
}
|
||||
|
||||
nsresult nsCocoaUtils::CreateCGImageFromSurface(SourceSurface* aSurface,
|
||||
CGImageRef* aResult)
|
||||
{
|
||||
RefPtr<DataSourceSurface> dataSurface = aSurface->GetDataSurface();
|
||||
|
||||
MOZ_ASSERT(dataSurface->GetFormat() == SurfaceFormat::B8G8R8A8,
|
||||
"We assume B8G8R8A8 when calling CGImageCreate");
|
||||
|
||||
int32_t width = dataSurface->GetSize().width;
|
||||
int32_t height = dataSurface->GetSize().height;
|
||||
if (height < 1 || width < 1) {
|
||||
int32_t width = aFrame->Width();
|
||||
int32_t stride = aFrame->Stride();
|
||||
int32_t height = aFrame->Height();
|
||||
if ((stride % 4 != 0) || (height < 1) || (width < 1)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
DataSourceSurface::MappedSurface map;
|
||||
dataSurface->Map(DataSourceSurface::MapType::READ, &map);
|
||||
NS_ENSURE_TRUE(map.mData, NS_ERROR_FAILURE);
|
||||
|
||||
// Create a CGImageRef with the bits from the image, taking into account
|
||||
// the alpha ordering and endianness of the machine so we don't have to
|
||||
// touch the bits ourselves.
|
||||
CGDataProviderRef dataProvider = ::CGDataProviderCreateWithData(dataSurface.forget().drop(),
|
||||
map.mData,
|
||||
map.mStride * height,
|
||||
data_ss_release_callback);
|
||||
CGDataProviderRef dataProvider = ::CGDataProviderCreateWithData(NULL,
|
||||
aFrame->Data(),
|
||||
stride * height,
|
||||
NULL);
|
||||
CGColorSpaceRef colorSpace = ::CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
|
||||
*aResult = ::CGImageCreate(width,
|
||||
height,
|
||||
8,
|
||||
32,
|
||||
map.mStride,
|
||||
stride,
|
||||
colorSpace,
|
||||
kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst,
|
||||
dataProvider,
|
||||
@ -372,7 +348,7 @@ nsresult nsCocoaUtils::CreateNSImageFromCGImage(CGImageRef aInputImage, NSImage
|
||||
|
||||
nsresult nsCocoaUtils::CreateNSImageFromImageContainer(imgIContainer *aImage, uint32_t aWhichFrame, NSImage **aResult, CGFloat scaleFactor)
|
||||
{
|
||||
RefPtr<SourceSurface> surface;
|
||||
nsRefPtr<gfxImageSurface> frame;
|
||||
int32_t width = 0, height = 0;
|
||||
aImage->GetWidth(&width);
|
||||
aImage->GetHeight(&height);
|
||||
@ -382,8 +358,7 @@ nsresult nsCocoaUtils::CreateNSImageFromImageContainer(imgIContainer *aImage, ui
|
||||
int scaledWidth = (int)ceilf(width * scaleFactor);
|
||||
int scaledHeight = (int)ceilf(height * scaleFactor);
|
||||
|
||||
nsRefPtr<gfxImageSurface> frame =
|
||||
new gfxImageSurface(gfxIntSize(scaledWidth, scaledHeight), gfxImageFormat::ARGB32);
|
||||
frame = new gfxImageSurface(gfxIntSize(scaledWidth, scaledHeight), gfxImageFormat::ARGB32);
|
||||
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
|
||||
|
||||
nsRefPtr<gfxContext> context = new gfxContext(frame);
|
||||
@ -394,27 +369,19 @@ nsresult nsCocoaUtils::CreateNSImageFromImageContainer(imgIContainer *aImage, ui
|
||||
nsIntRect(0, 0, width, height),
|
||||
nsIntSize(scaledWidth, scaledHeight),
|
||||
nullptr, aWhichFrame, imgIContainer::FLAG_SYNC_DECODE);
|
||||
|
||||
surface =
|
||||
gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, frame);
|
||||
} else {
|
||||
nsRefPtr<gfxASurface> thebesSurface =
|
||||
aImage->GetFrame(aWhichFrame, imgIContainer::FLAG_SYNC_DECODE);
|
||||
NS_ENSURE_TRUE(thebesSurface, NS_ERROR_FAILURE);
|
||||
|
||||
nsRefPtr<gfxImageSurface> thebesImageSurface =
|
||||
thebesSurface->GetAsReadableARGB32ImageSurface();
|
||||
NS_ENSURE_TRUE(thebesImageSurface, NS_ERROR_FAILURE);
|
||||
|
||||
surface =
|
||||
gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr,
|
||||
thebesImageSurface);
|
||||
}
|
||||
|
||||
NS_ENSURE_TRUE(surface, NS_ERROR_FAILURE);
|
||||
else {
|
||||
nsRefPtr<gfxASurface> surface =
|
||||
aImage->GetFrame(aWhichFrame, imgIContainer::FLAG_SYNC_DECODE);
|
||||
NS_ENSURE_TRUE(surface, NS_ERROR_FAILURE);
|
||||
|
||||
frame = surface->GetAsReadableARGB32ImageSurface();
|
||||
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
CGImageRef imageRef = NULL;
|
||||
nsresult rv = nsCocoaUtils::CreateCGImageFromSurface(surface, &imageRef);
|
||||
nsresult rv = nsCocoaUtils::CreateCGImageFromSurface(frame, &imageRef);
|
||||
if (NS_FAILED(rv) || !imageRef) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -37,14 +37,11 @@
|
||||
#include "imgRequestProxy.h"
|
||||
#include "nsMenuItemX.h"
|
||||
#include "gfxImageSurface.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "imgIContainer.h"
|
||||
#include "nsCocoaUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
using mozilla::gfx::SourceSurface;
|
||||
using mozilla::RefPtr;
|
||||
|
||||
static const uint32_t kIconWidth = 16;
|
||||
static const uint32_t kIconHeight = 16;
|
||||
static const uint32_t kIconBitsPerComponent = 8;
|
||||
@ -388,20 +385,18 @@ nsMenuItemIconX::OnStopFrame(imgIRequest* aRequest)
|
||||
mImageRegionRect.SetRect(0, 0, origWidth, origHeight);
|
||||
}
|
||||
|
||||
nsRefPtr<gfxASurface> thebesSurface =
|
||||
nsRefPtr<gfxASurface> surface =
|
||||
imageContainer->GetFrame(imgIContainer::FRAME_CURRENT,
|
||||
imgIContainer::FLAG_NONE);
|
||||
if (!thebesSurface) {
|
||||
if (!surface) {
|
||||
[mNativeMenuItem setImage:nil];
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
RefPtr<SourceSurface> surface =
|
||||
gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr,
|
||||
thebesSurface);
|
||||
NS_ENSURE_TRUE(surface, NS_ERROR_FAILURE);
|
||||
nsRefPtr<gfxImageSurface> frame(surface->GetAsReadableARGB32ImageSurface());
|
||||
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
|
||||
|
||||
CGImageRef origImage = NULL;
|
||||
nsresult rv = nsCocoaUtils::CreateCGImageFromSurface(surface, &origImage);
|
||||
nsresult rv = nsCocoaUtils::CreateCGImageFromSurface(frame, &origImage);
|
||||
if (NS_FAILED(rv) || !origImage) {
|
||||
[mNativeMenuItem setImage:nil];
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "cutils/properties.h"
|
||||
#include "gfx2DGlue.h"
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
#if ANDROID_VERSION >= 17
|
||||
#include "libdisplay/FramebufferSurface.h"
|
||||
#ifndef HWC_BLIT
|
||||
#define HWC_BLIT (HWC_FRAMEBUFFER_TARGET + 1)
|
||||
@ -92,7 +92,7 @@ HwcComposer2D::Init(hwc_display_t dpy, hwc_surface_t sur)
|
||||
mozilla::Framebuffer::GetSize(&screenSize);
|
||||
mScreenRect = nsIntRect(nsIntPoint(0, 0), screenSize);
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
#if ANDROID_VERSION >= 17
|
||||
int supported = 0;
|
||||
if (mHwc->query(mHwc, HwcUtils::HWC_COLOR_FILL, &supported) == NO_ERROR) {
|
||||
mColorFill = supported ? true : false;
|
||||
@ -303,12 +303,14 @@ HwcComposer2D::PrepareLayerList(Layer* aLayer,
|
||||
if ((opacity == 0xFF) && (aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE)) {
|
||||
hwcLayer.blending = HWC_BLENDING_NONE;
|
||||
}
|
||||
#if ANDROID_VERSION >= 18
|
||||
#if ANDROID_VERSION >= 17
|
||||
hwcLayer.compositionType = HWC_FRAMEBUFFER;
|
||||
|
||||
hwcLayer.acquireFenceFd = -1;
|
||||
hwcLayer.releaseFenceFd = -1;
|
||||
#if ANDROID_VERSION >= 18
|
||||
hwcLayer.planeAlpha = opacity;
|
||||
#endif
|
||||
#else
|
||||
hwcLayer.compositionType = HwcUtils::HWC_USE_COPYBIT;
|
||||
#endif
|
||||
@ -472,7 +474,7 @@ HwcComposer2D::PrepareLayerList(Layer* aLayer,
|
||||
}
|
||||
|
||||
|
||||
#if ANDROID_VERSION >= 18
|
||||
#if ANDROID_VERSION >= 17
|
||||
bool
|
||||
HwcComposer2D::TryHwComposition()
|
||||
{
|
||||
@ -628,8 +630,9 @@ HwcComposer2D::Prepare(buffer_handle_t fbHandle, int fence)
|
||||
mList->hwLayers[idx].visibleRegionScreen.rects = &mList->hwLayers[idx].displayFrame;
|
||||
mList->hwLayers[idx].acquireFenceFd = fence;
|
||||
mList->hwLayers[idx].releaseFenceFd = -1;
|
||||
#if ANDROID_VERSION >= 18
|
||||
mList->hwLayers[idx].planeAlpha = 0xFF;
|
||||
|
||||
#endif
|
||||
if (mPrepared) {
|
||||
LOGE("Multiple hwc prepare calls!");
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class Layer;
|
||||
//Holds a dynamically allocated vector of rectangles
|
||||
//used to decribe the complex visible region of a layer
|
||||
typedef std::vector<hwc_rect_t> RectVector;
|
||||
#if ANDROID_VERSION >= 18
|
||||
#if ANDROID_VERSION >= 17
|
||||
typedef hwc_composer_device_1_t HwcDevice;
|
||||
typedef hwc_display_contents_1_t HwcList;
|
||||
typedef hwc_layer_1_t HwcLayer;
|
||||
|
Loading…
Reference in New Issue
Block a user