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

Unified Diff: tests/RecordReplaceDrawTest.cpp

Issue 779973002: Fix up RecordReplaceDrawTest memory leak. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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: tests/RecordReplaceDrawTest.cpp
diff --git a/tests/RecordReplaceDrawTest.cpp b/tests/RecordReplaceDrawTest.cpp
index edd4766c5f5c29d089a97c1a9826bcf509d8bac4..f1ebf82de0e72f0de2e75440ddba6a9fd34597c9 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;
« 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