uint32_t -> int for texture extents
Review URL: http://codereview.appspot.com/4584053/
git-svn-id: http://skia.googlecode.com/svn/trunk@1574 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrGLTexture.h b/gpu/include/GrGLTexture.h
index cb50a1e..b4713a4 100644
--- a/gpu/include/GrGLTexture.h
+++ b/gpu/include/GrGLTexture.h
@@ -141,10 +141,10 @@
};
struct GLTextureDesc {
- uint32_t fContentWidth;
- uint32_t fContentHeight;
- uint32_t fAllocWidth;
- uint32_t fAllocHeight;
+ int fContentWidth;
+ int fContentHeight;
+ int fAllocWidth;
+ int fAllocHeight;
GrPixelConfig fFormat;
GrGLuint fTextureID;
bool fOwnsID;
@@ -165,10 +165,10 @@
virtual ~GrGLTexture() { this->release(); }
// overrides of GrTexture
- virtual void uploadTextureData(uint32_t x,
- uint32_t y,
- uint32_t width,
- uint32_t height,
+ virtual void uploadTextureData(int x,
+ int y,
+ int width,
+ int height,
const void* srcData);
virtual intptr_t getTextureHandle();
diff --git a/gpu/include/GrTexture.h b/gpu/include/GrTexture.h
index 0e2f369..7815997 100644
--- a/gpu/include/GrTexture.h
+++ b/gpu/include/GrTexture.h
@@ -208,10 +208,10 @@
* @param srcData width*height texels of data in same format that was used
* at texture creation.
*/
- virtual void uploadTextureData(uint32_t x,
- uint32_t y,
- uint32_t width,
- uint32_t height,
+ virtual void uploadTextureData(int x,
+ int y,
+ int width,
+ int height,
const void* srcData) = 0;
/**
diff --git a/gpu/include/GrTypes.h b/gpu/include/GrTypes.h
index e6f3e2c..01b8e25 100644
--- a/gpu/include/GrTypes.h
+++ b/gpu/include/GrTypes.h
@@ -359,8 +359,8 @@
* fFlags contains kRenderTarget_GrTextureFlag.
*/
GrAALevels fAALevel;
- uint32_t fWidth; //!< Width of the texture
- uint32_t fHeight; //!< Height of the texture
+ int fWidth; //!< Width of the texture
+ int fHeight; //!< Height of the texture
/**
* Format of source data of the texture. Not guaraunteed to be the same as
* internal format used by 3D API.
diff --git a/gpu/src/GrGLTexture.cpp b/gpu/src/GrGLTexture.cpp
index d3ccfa6..59b1162 100644
--- a/gpu/src/GrGLTexture.cpp
+++ b/gpu/src/GrGLTexture.cpp
@@ -153,10 +153,10 @@
}
}
-void GrGLTexture::uploadTextureData(uint32_t x,
- uint32_t y,
- uint32_t width,
- uint32_t height,
+void GrGLTexture::uploadTextureData(int x,
+ int y,
+ int width,
+ int height,
const void* srcData) {
GPUGL->setSpareTextureUnit();
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp
index 2d7d512..cbfcc6e 100644
--- a/gpu/src/GrGpuGL.cpp
+++ b/gpu/src/GrGpuGL.cpp
@@ -770,7 +770,7 @@
size_t trimSize = desc.fHeight * trimRowBytes;
const char* src = (const char*)srcData;
char* dst = (char*)trimStorage.realloc(trimSize);
- for (uint32_t y = 0; y < desc.fHeight; y++) {
+ for (int y = 0; y < desc.fHeight; y++) {
memcpy(dst, src, trimRowBytes);
src += rowBytes;
dst += trimRowBytes;
@@ -786,19 +786,19 @@
glDesc.fAllocHeight = GrNextPow2(desc.fHeight);
}
- glDesc.fAllocWidth = GrMax<int>(fMinRenderTargetWidth,
- glDesc.fAllocWidth);
- glDesc.fAllocHeight = GrMax<int>(fMinRenderTargetHeight,
- glDesc.fAllocHeight);
- if ((int)glDesc.fAllocWidth > fMaxRenderTargetSize ||
- (int)glDesc.fAllocHeight > fMaxRenderTargetSize) {
+ glDesc.fAllocWidth = GrMax(fMinRenderTargetWidth,
+ glDesc.fAllocWidth);
+ glDesc.fAllocHeight = GrMax(fMinRenderTargetHeight,
+ glDesc.fAllocHeight);
+ if (glDesc.fAllocWidth > fMaxRenderTargetSize ||
+ glDesc.fAllocHeight > fMaxRenderTargetSize) {
return return_null_texture();
}
} else if (!this->npotTextureSupport()) {
glDesc.fAllocWidth = GrNextPow2(desc.fWidth);
glDesc.fAllocHeight = GrNextPow2(desc.fHeight);
- if ((int)glDesc.fAllocWidth > fMaxTextureSize ||
- (int)glDesc.fAllocHeight > fMaxTextureSize) {
+ if (glDesc.fAllocWidth > fMaxTextureSize ||
+ glDesc.fAllocHeight > fMaxTextureSize) {
return return_null_texture();
}
}
@@ -840,9 +840,9 @@
glDesc.fUploadType, srcData));
GrGLRestoreResetRowLength();
- uint32_t extraW = glDesc.fAllocWidth - desc.fWidth;
- uint32_t extraH = glDesc.fAllocHeight - desc.fHeight;
- uint32_t maxTexels = extraW * extraH;
+ int extraW = glDesc.fAllocWidth - desc.fWidth;
+ int extraH = glDesc.fAllocHeight - desc.fHeight;
+ int maxTexels = extraW * extraH;
maxTexels = GrMax(extraW * desc.fHeight, maxTexels);
maxTexels = GrMax(desc.fWidth * extraH, maxTexels);
@@ -854,7 +854,7 @@
(desc.fHeight - 1) * rowSize;
uint8_t* extraRowStart = (uint8_t*)texels.get();
- for (uint32_t i = 0; i < extraH; ++i) {
+ for (int i = 0; i < extraH; ++i) {
memcpy(extraRowStart, lastRowStart, rowSize);
extraRowStart += rowSize;
}
@@ -865,8 +865,8 @@
if (extraW) {
uint8_t* edgeTexel = (uint8_t*)srcData + rowSize - glDesc.fUploadByteCount;
uint8_t* extraTexel = (uint8_t*)texels.get();
- for (uint32_t j = 0; j < desc.fHeight; ++j) {
- for (uint32_t i = 0; i < extraW; ++i) {
+ for (int j = 0; j < desc.fHeight; ++j) {
+ for (int i = 0; i < extraW; ++i) {
memcpy(extraTexel, edgeTexel, glDesc.fUploadByteCount);
extraTexel += glDesc.fUploadByteCount;
}
@@ -880,7 +880,7 @@
uint8_t* cornerTexel = (uint8_t*)srcData + desc.fHeight * rowSize
- glDesc.fUploadByteCount;
uint8_t* extraTexel = (uint8_t*)texels.get();
- for (uint32_t i = 0; i < extraW*extraH; ++i) {
+ for (int i = 0; i < extraW*extraH; ++i) {
memcpy(extraTexel, cornerTexel, glDesc.fUploadByteCount);
extraTexel += glDesc.fUploadByteCount;
}