aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-29 19:26:48 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-29 19:26:48 +0000
commitf9bd04faffb936602f7f957413a8cd5b7fc44add (patch)
tree2088b40dd21787a473356b3021e15c7e528b6824 /src/gpu/GrContext.cpp
parent0365261597f73c049f2d8c117c8c87ef2fb2c9ab (diff)
Constify the arguments to createTexture
R=bsalomon@google.com, robertphillips@google.com Author: krajcevski@google.com Review URL: https://codereview.chromium.org/301993002 git-svn-id: http://skia.googlecode.com/svn/trunk@14975 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r--src/gpu/GrContext.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index baa002a54a..bea0f58419 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -271,7 +271,7 @@ GrStencilBuffer* GrContext::findStencilBuffer(int width, int height,
static void stretch_image(void* dst,
int dstW,
int dstH,
- void* src,
+ const void* src,
int srcW,
int srcH,
size_t bpp) {
@@ -283,12 +283,10 @@ static void stretch_image(void* dst,
size_t dstXLimit = dstW*bpp;
for (int j = 0; j < dstH; ++j) {
SkFixed x = dx >> 1;
- void* srcRow = (uint8_t*)src + (y>>16)*srcW*bpp;
- void* dstRow = (uint8_t*)dst + j*dstW*bpp;
+ const uint8_t* srcRow = reinterpret_cast<const uint8_t *>(src) + (y>>16)*srcW*bpp;
+ uint8_t* dstRow = reinterpret_cast<uint8_t *>(dst) + j*dstW*bpp;
for (size_t i = 0; i < dstXLimit; i += bpp) {
- memcpy((uint8_t*) dstRow + i,
- (uint8_t*) srcRow + (x>>16)*bpp,
- bpp);
+ memcpy(dstRow + i, srcRow + (x>>16)*bpp, bpp);
x += dx;
}
y += dy;
@@ -309,7 +307,7 @@ extern const GrVertexAttrib gVertexAttribs[] = {
// the current hardware. Resize the texture to be a POT
GrTexture* GrContext::createResizedTexture(const GrTextureDesc& desc,
const GrCacheID& cacheID,
- void* srcData,
+ const void* srcData,
size_t rowBytes,
bool filter) {
SkAutoTUnref<GrTexture> clampedTexture(this->findAndRefTexture(desc, cacheID, NULL));
@@ -379,7 +377,7 @@ GrTexture* GrContext::createResizedTexture(const GrTextureDesc& desc,
GrTexture* GrContext::createTexture(const GrTextureParams* params,
const GrTextureDesc& desc,
const GrCacheID& cacheID,
- void* srcData,
+ const void* srcData,
size_t rowBytes,
GrResourceKey* cacheKey) {
GrResourceKey resourceKey = GrTextureImpl::ComputeKey(fGpu, params, desc, cacheID);