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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1811723002: free -> reset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: zarro boogs found Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « bench/GrMemoryPoolBench.cpp ('k') | include/core/SkTypes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "DMSrcSink.h" 8 #include "DMSrcSink.h"
9 #include "SkAndroidCodec.h" 9 #include "SkAndroidCodec.h"
10 #include "SkCodec.h" 10 #include "SkCodec.h"
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 buffer.reset(); 1404 buffer.reset();
1405 SkASSERT(mojoPicture.get() && mojoPicture->data); 1405 SkASSERT(mojoPicture.get() && mojoPicture->data);
1406 1406
1407 size_t flatSize = mojoPicture->GetSerializedSize(); 1407 size_t flatSize = mojoPicture->GetSerializedSize();
1408 SkAutoMalloc storage(flatSize); 1408 SkAutoMalloc storage(flatSize);
1409 if (!mojoPicture->Serialize(storage.get(), flatSize)) { 1409 if (!mojoPicture->Serialize(storage.get(), flatSize)) {
1410 return "SkMojo::FlattenedPicture::Serialize failed"; 1410 return "SkMojo::FlattenedPicture::Serialize failed";
1411 } 1411 }
1412 mojoPicture = SkMojo::FlattenedPicture::New(); 1412 mojoPicture = SkMojo::FlattenedPicture::New();
1413 mojoPicture->Deserialize(storage.get()); 1413 mojoPicture->Deserialize(storage.get());
1414 storage.free(); 1414 storage.reset();
1415 if (!mojoPicture) { 1415 if (!mojoPicture) {
1416 return "SkMojo::FlattenedPicture::Deserialize failed"; 1416 return "SkMojo::FlattenedPicture::Deserialize failed";
1417 } 1417 }
1418 SkMemoryStream tmpStream(mojoPicture->data.data(), 1418 SkMemoryStream tmpStream(mojoPicture->data.data(),
1419 mojoPicture->data.size()); 1419 mojoPicture->data.size());
1420 skPicture.reset(SkPicture::CreateFromStream(&tmpStream)); 1420 skPicture.reset(SkPicture::CreateFromStream(&tmpStream));
1421 mojoPicture.reset(); 1421 mojoPicture.reset();
1422 auto fn = [&](SkCanvas* canvas) -> Error { 1422 auto fn = [&](SkCanvas* canvas) -> Error {
1423 canvas->drawPicture(skPicture.get()); 1423 canvas->drawPicture(skPicture.get());
1424 return check_against_reference(bitmap, src, fSink); 1424 return check_against_reference(bitmap, src, fSink);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 skr.visit<void>(i, drawsAsSingletonPictures); 1495 skr.visit<void>(i, drawsAsSingletonPictures);
1496 } 1496 }
1497 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1497 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1498 1498
1499 canvas->drawPicture(macroPic); 1499 canvas->drawPicture(macroPic);
1500 return check_against_reference(bitmap, src, fSink); 1500 return check_against_reference(bitmap, src, fSink);
1501 }); 1501 });
1502 } 1502 }
1503 1503
1504 } // namespace DM 1504 } // namespace DM
OLDNEW
« no previous file with comments | « bench/GrMemoryPoolBench.cpp ('k') | include/core/SkTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698