aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authordan sinclair <dsinclair@google.com>2019-09-30 13:22:18 -0400
committerGitHub <noreply@github.com>2019-09-30 13:22:18 -0400
commit8348fd411b80336dbf013305e861570c50d53f40 (patch)
tree99910d0617227c58d6b8f51db5ac5c2b656f2e0c /samples
parent3624da9a117643a3d6cb12f80838f668f763c89e (diff)
downloadamber-8348fd411b80336dbf013305e861570c50d53f40.tar.gz
Store formats in pipeline and scripts. (#677)
This CL removes the unique_ptr from the probe and buffer classes and stores pointers instead. The lifetimes are managed by the pipeline and script objects. This removes the need to do the copy and assignment operators for the format class.
Diffstat (limited to 'samples')
-rw-r--r--samples/image_diff.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/samples/image_diff.cc b/samples/image_diff.cc
index bba657e..033d412 100644
--- a/samples/image_diff.cc
+++ b/samples/image_diff.cc
@@ -115,11 +115,11 @@ int main(int argc, const char** argv) {
return 1;
}
+ amber::FormatParser fp;
+ auto fmt = fp.Parse("R8G8B8A8_UNORM");
amber::Buffer buffers[2];
-
for (size_t i = 0; i < 2; ++i) {
- amber::FormatParser fp;
- buffers[i].SetFormat(fp.Parse("R8G8B8A8_UNORM"));
+ buffers[i].SetFormat(fmt.get());
amber::Result res =
LoadPngToBuffer(options.input_filenames[i], &buffers[i]);
if (!res.IsSuccess()) {