Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 2342903003: Keeping asserts in release. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Gpu.cpp
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 06ec224a2a9cbc23fa02b83288128a4252329b26..7eb728f55da8b3d524d1b6039f278fcb9379b554 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -583,7 +583,6 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox
FILL_MEMBER(dtiBufferFiller, fColorTableCnt, &ctCount);
FILL_MEMBER(dtiBufferFiller, fColorTableData, &ct);
FILL_MEMBER(dtiBufferFiller, fMipMapLevelCount, &mipMapLevelCount);
-// FILL_MEMBER(dtiBufferFiller, fMipMapLevelCount[0].fPixelData, &pixels);
memcpy(reinterpret_cast<void*>(bufferAsInt +
offsetof(DeferredTextureImage, fMipMapLevelData[0].fPixelData)),
&pixels, sizeof(pixels));
@@ -605,11 +604,11 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox
}
// Fill in the mipmap levels if they exist
- intptr_t mipLevelPtr = bufferAsInt + pixelOffset + SkAlign8(pixmap.getSafeSize());
+ intptr_t mipLevelPtr = pixelsAsInt + SkAlign8(pixmap.getSafeSize());
if (useMipMaps) {
- // offsetof, which we use below, requires the type have standard layout
- SkASSERT(std::is_standard_layout<MipMapLevelData>::value);
+ static_assert(std::is_standard_layout<MipMapLevelData>::value,
+ "offsetof, which we use below, requires the type have a standard layout");
SkAutoTDelete<SkMipMap> mipmaps(SkMipMap::Build(pixmap, gammaTreatment, nullptr));
// SkMipMap holds only the mipmap levels it generates.
@@ -626,11 +625,11 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox
mipmaps->getLevel(generatedMipLevelIndex, &mipLevel);
// Make sure the mipmap data is after the start of the buffer
- SkASSERT(mipLevelPtr > bufferAsInt);
+ SkASSERT_RELEASE(mipLevelPtr > bufferAsInt);
// Make sure the mipmap data starts before the end of the buffer
- SkASSERT(static_cast<size_t>(mipLevelPtr) < bufferAsInt + pixelOffset + pixelSize);
+ SkASSERT_RELEASE(static_cast<size_t>(mipLevelPtr) < bufferAsInt + pixelOffset + pixelSize);
// Make sure the mipmap data ends before the end of the buffer
- SkASSERT(mipLevelPtr + mipLevel.fPixmap.getSafeSize() <=
+ SkASSERT_RELEASE(mipLevelPtr + mipLevel.fPixmap.getSafeSize() <=
bufferAsInt + pixelOffset + pixelSize);
// getSafeSize includes rowbyte padding except for the last row,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698