diff options
author | mtklein <mtklein@chromium.org> | 2014-12-04 07:53:21 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-04 07:53:21 -0800 |
commit | c88cedaf8806cc9afa36497dc93eb0d1c329fb6c (patch) | |
tree | 03e6f86b100e982ed690f6fe6aff1d3bc0233d51 | |
parent | 8eddfb50c0c9e4bcba6384a2ce39852b5fb5becb (diff) |
Fix up RecordReplaceDrawTest memory leak.
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/151/steps/dm/logs/stdio
BUG=skia:
Review URL: https://codereview.chromium.org/779973002
-rw-r--r-- | tests/RecordReplaceDrawTest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/RecordReplaceDrawTest.cpp b/tests/RecordReplaceDrawTest.cpp index edd4766c5f..f1ebf82de0 100644 --- a/tests/RecordReplaceDrawTest.cpp +++ b/tests/RecordReplaceDrawTest.cpp @@ -94,8 +94,8 @@ void test_replacements(skiatest::Reporter* r, GrContext* context, bool useBBH) { SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kWidth), SkIntToScalar(kHeight), useBBH ? &bbhFactory : NULL); - SkAutoTDelete<SkPaint> paint(SkNEW(SkPaint)); - canvas->saveLayer(NULL, paint); + SkPaint paint; + canvas->saveLayer(NULL, &paint); canvas->clear(SK_ColorRED); canvas->restore(); canvas->drawRect(SkRect::MakeWH(SkIntToScalar(kWidth / 2), SkIntToScalar(kHeight / 2)), @@ -105,10 +105,11 @@ void test_replacements(skiatest::Reporter* r, GrContext* context, bool useBBH) { unsigned key[1] = { 0 }; + SkPaint paint; GrLayerCache* layerCache = context->getLayerCache(); - GrCachedLayer* layer = layerCache->findLayerOrCreate(pic->uniqueID(), 0, 2, + GrCachedLayer* layer = layerCache->findLayerOrCreate(pic->uniqueID(), 0, 2, SkIRect::MakeWH(kWidth, kHeight), - SkMatrix::I(), key, 1, SkNEW(SkPaint)); + SkMatrix::I(), key, 1, &paint); GrSurfaceDesc desc; desc.fConfig = kSkia8888_GrPixelConfig; |