diff options
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/2d/Types.h | 10 | ||||
-rw-r--r-- | gfx/skia/skia/include/core/SkPath.h | 2 | ||||
-rw-r--r-- | gfx/skia/skia/src/core/SkPath.cpp | 8 | ||||
-rw-r--r-- | gfx/skia/skia/src/gpu/GrBufferAllocPool.cpp | 11 |
4 files changed, 14 insertions, 17 deletions
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/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); } |