summaryrefslogtreecommitdiffstats
path: root/gfx
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-04-05 20:01:10 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-04-05 20:01:10 +0200
commitc3b63b831cd2c64700e875b28540212c7c881ac6 (patch)
treeedd98fcbd2004d3b562904f822bf6c3322fc7f52 /gfx
parentd432e068a21c815d5d5e7bcbc1cc8c6e77a7d1e0 (diff)
parentcc07da9cb4d6e7a53f8d953427ffc2bca2e0c2df (diff)
downloadUXP-c3b63b831cd2c64700e875b28540212c7c881ac6.tar
UXP-c3b63b831cd2c64700e875b28540212c7c881ac6.tar.gz
UXP-c3b63b831cd2c64700e875b28540212c7c881ac6.tar.lz
UXP-c3b63b831cd2c64700e875b28540212c7c881ac6.tar.xz
UXP-c3b63b831cd2c64700e875b28540212c7c881ac6.zip
Merge branch 'master' into 816
Diffstat (limited to 'gfx')
-rw-r--r--gfx/2d/2D.h3
-rw-r--r--gfx/2d/Types.h10
-rw-r--r--gfx/cairo/libpixman/src/pixman.h2
-rw-r--r--gfx/ipc/GPUParent.cpp1
-rw-r--r--gfx/ipc/moz.build1
-rw-r--r--gfx/qcms/qcmstypes.h2
-rw-r--r--gfx/skia/skia/include/core/SkPath.h2
-rw-r--r--gfx/skia/skia/src/core/SkPath.cpp8
-rw-r--r--gfx/skia/skia/src/gpu/GrBufferAllocPool.cpp11
-rw-r--r--gfx/thebes/gfxFontconfigFonts.cpp7
10 files changed, 17 insertions, 30 deletions
diff --git a/gfx/2d/2D.h b/gfx/2d/2D.h
index c1fba3463..e2020dc9e 100644
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -488,6 +488,9 @@ public:
/**
* Returns a DataSourceSurface with the same data as this one, but
* guaranteed to have surface->GetType() == SurfaceType::DATA.
+ *
+ * The returning surface might be null, because of OOM or gfx device reset.
+ * The caller needs to do null-check before using it.
*/
virtual already_AddRefed<DataSourceSurface> GetDataSurface() override;
diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h
index 7b1676ab2..3cdf077b1 100644
--- a/gfx/2d/Types.h
+++ b/gfx/2d/Types.h
@@ -65,18 +65,8 @@ enum class SurfaceFormat : int8_t {
// This represents the unknown format.
UNKNOWN,
- // The following values are endian-independent synonyms. The _UINT32 suffix
- // indicates that the name reflects the layout when viewed as a uint32_t
- // value.
-#if MOZ_LITTLE_ENDIAN
A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB
X8R8G8B8_UINT32 = B8G8R8X8 // 0x00RRGGBB
-#elif MOZ_BIG_ENDIAN
- A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB
- X8R8G8B8_UINT32 = X8R8G8B8 // 0x00RRGGBB
-#else
-# error "bad endianness"
-#endif
};
inline bool IsOpaque(SurfaceFormat aFormat)
diff --git a/gfx/cairo/libpixman/src/pixman.h b/gfx/cairo/libpixman/src/pixman.h
index 1cbf62e21..23408b028 100644
--- a/gfx/cairo/libpixman/src/pixman.h
+++ b/gfx/cairo/libpixman/src/pixman.h
@@ -104,8 +104,6 @@ typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
-#elif defined (_AIX)
-# include <sys/inttypes.h>
#else
# include <stdint.h>
#endif
diff --git a/gfx/ipc/GPUParent.cpp b/gfx/ipc/GPUParent.cpp
index 9ff6cba9e..6833f5690 100644
--- a/gfx/ipc/GPUParent.cpp
+++ b/gfx/ipc/GPUParent.cpp
@@ -24,7 +24,6 @@
#include "mozilla/dom/VideoDecoderManagerChild.h"
#include "mozilla/layers/LayerTreeOwnerTracker.h"
#include "nsDebugImpl.h"
-#include "nsExceptionHandler.h"
#include "nsThreadManager.h"
#include "prenv.h"
#include "ProcessUtils.h"
diff --git a/gfx/ipc/moz.build b/gfx/ipc/moz.build
index ff3a81228..309681444 100644
--- a/gfx/ipc/moz.build
+++ b/gfx/ipc/moz.build
@@ -70,7 +70,6 @@ IPDL_SOURCES = [
LOCAL_INCLUDES += [
'/dom/ipc',
- '/toolkit/crashreporter',
'/xpcom/threads',
]
diff --git a/gfx/qcms/qcmstypes.h b/gfx/qcms/qcmstypes.h
index d36779183..d5f843f79 100644
--- a/gfx/qcms/qcmstypes.h
+++ b/gfx/qcms/qcmstypes.h
@@ -38,8 +38,6 @@ typedef unsigned __int64 uintptr_t;
typedef unsigned long uintptr_t;
#endif
-#elif defined (_AIX)
-# include <sys/inttypes.h>
#else
# include <stdint.h>
#endif
diff --git a/gfx/skia/skia/include/core/SkPath.h b/gfx/skia/skia/include/core/SkPath.h
index d1af4f31b..bde07c498 100644
--- a/gfx/skia/skia/include/core/SkPath.h
+++ b/gfx/skia/skia/include/core/SkPath.h
@@ -373,7 +373,7 @@ public:
@param extraPtCount The number of extra points the path should
preallocate for.
*/
- void incReserve(unsigned extraPtCount);
+ void incReserve(int extraPtCount);
/** Set the beginning of the next contour to the point (x,y).
diff --git a/gfx/skia/skia/src/core/SkPath.cpp b/gfx/skia/skia/src/core/SkPath.cpp
index 8f93c9c18..fc3db3ee5 100644
--- a/gfx/skia/skia/src/core/SkPath.cpp
+++ b/gfx/skia/skia/src/core/SkPath.cpp
@@ -716,9 +716,11 @@ void SkPath::setConvexity(Convexity c) {
fFirstDirection = SkPathPriv::kUnknown_FirstDirection; \
} while (0)
-void SkPath::incReserve(U16CPU inc) {
+void SkPath::incReserve(int inc) {
SkDEBUGCODE(this->validate();)
- SkPathRef::Editor(&fPathRef, inc, inc);
+ if (inc > 0) {
+ SkPathRef::Editor(&fPathRef, inc, inc);
+ }
SkDEBUGCODE(this->validate();)
}
@@ -1742,7 +1744,7 @@ void SkPath::transform(const SkMatrix& matrix, SkPath* dst) const {
if (this != dst) {
dst->fFillType = fFillType;
- dst->fConvexity = fConvexity;
+ dst->fConvexity = kUnknown_Convexity;
dst->fIsVolatile = fIsVolatile;
}
diff --git a/gfx/skia/skia/src/gpu/GrBufferAllocPool.cpp b/gfx/skia/skia/src/gpu/GrBufferAllocPool.cpp
index 993e1c59d..c6097b03b 100644
--- a/gfx/skia/skia/src/gpu/GrBufferAllocPool.cpp
+++ b/gfx/skia/skia/src/gpu/GrBufferAllocPool.cpp
@@ -152,13 +152,18 @@ void* GrBufferAllocPool::makeSpace(size_t size,
BufferBlock& back = fBlocks.back();
size_t usedBytes = back.fBuffer->gpuMemorySize() - back.fBytesFree;
size_t pad = GrSizeAlignUpPad(usedBytes, alignment);
- if ((size + pad) <= back.fBytesFree) {
+ SkSafeMath safeMath;
+ size_t alignedSize = safeMath.add(pad, size);
+ if (!safeMath.ok()) {
+ return nullptr;
+ }
+ if (alignedSize <= back.fBytesFree) {
memset((void*)(reinterpret_cast<intptr_t>(fBufferPtr) + usedBytes), 0, pad);
usedBytes += pad;
*offset = usedBytes;
*buffer = back.fBuffer;
- back.fBytesFree -= size + pad;
- fBytesInUse += size + pad;
+ back.fBytesFree -= alignedSize;
+ fBytesInUse += alignedSize;
VALIDATE();
return (void*)(reinterpret_cast<intptr_t>(fBufferPtr) + usedBytes);
}
diff --git a/gfx/thebes/gfxFontconfigFonts.cpp b/gfx/thebes/gfxFontconfigFonts.cpp
index bbcbbabf9..9caecc4c0 100644
--- a/gfx/thebes/gfxFontconfigFonts.cpp
+++ b/gfx/thebes/gfxFontconfigFonts.cpp
@@ -1096,15 +1096,8 @@ gfxFcFontSet::SortPreferredFonts(bool &aWaitForUserFont)
FcFontSet *sets[1] = { fontSet };
FcResult result;
-#ifdef SOLARIS
- // Get around a crash of FcFontSetSort when FcConfig is nullptr
- // Solaris's FcFontSetSort needs an FcConfig (bug 474758)
- fontSet.own(FcFontSetSort(FcConfigGetCurrent(), sets, 1, mSortPattern,
- FcFalse, nullptr, &result));
-#else
fontSet.own(FcFontSetSort(nullptr, sets, 1, mSortPattern,
FcFalse, nullptr, &result));
-#endif
if (truncateMarker != nullptr && fontSet) {
nsAutoRef<FcFontSet> truncatedSet(FcFontSetCreate());