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

Unified Diff: gm/texdata.cpp

Issue 26440006: texdata gm: allocate gTextureData on the heap. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: even more Created 7 years, 2 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: gm/texdata.cpp
diff --git a/gm/texdata.cpp b/gm/texdata.cpp
index 645ced1e670586e40640a60341f358ed4ac77c29..d2e5d05b485d4b66a2ef283d5498d55469b12793 100644
--- a/gm/texdata.cpp
+++ b/gm/texdata.cpp
@@ -42,7 +42,7 @@ protected:
GrRenderTarget* target = device->accessRenderTarget();
GrContext* ctx = GM::GetGr(canvas);
if (ctx && target) {
- SkPMColor gTextureData[(2 * S) * (2 * S)];
+ SkAutoTArray<SkPMColor> gTextureData((2 * S) * (2 * S));
static const int stride = 2 * S;
static const SkPMColor gray = SkPackARGB32(0x40, 0x40, 0x40, 0x40);
static const SkPMColor white = SkPackARGB32(0xff, 0xff, 0xff, 0xff);
@@ -88,7 +88,7 @@ protected:
desc.fWidth = 2 * S;
desc.fHeight = 2 * S;
GrTexture* texture =
- ctx->createUncachedTexture(desc, gTextureData, 0);
+ ctx->createUncachedTexture(desc, gTextureData.get(), 0);
if (!texture) {
return;
@@ -127,7 +127,7 @@ protected:
}
}
texture->writePixels(S, (i ? 0 : S), S, S,
- texture->config(), gTextureData,
+ texture->config(), gTextureData.get(),
4 * stride);
ctx->drawRect(paint, SkRect::MakeWH(2*S, 2*S));
}
« 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