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

Side by Side Diff: gm/cgm.c

Issue 1199473002: change old picture serialization to really handle images (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | gm/factory.cpp » ('j') | gm/factory.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL 8 // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9 // DO NOT USE -- FOR INTERNAL TESTING ONLY 9 // DO NOT USE -- FOR INTERNAL TESTING ONLY
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 do_draw(sk_surface_get_canvas(surf)); 57 do_draw(sk_surface_get_canvas(surf));
58 58
59 sk_image_t* img0 = sk_surface_new_image_snapshot(surf); 59 sk_image_t* img0 = sk_surface_new_image_snapshot(surf);
60 sk_surface_unref(surf); 60 sk_surface_unref(surf);
61 61
62 sk_canvas_draw_image(canvas, img0, W + 10, 10, NULL); 62 sk_canvas_draw_image(canvas, img0, W + 10, 10, NULL);
63 63
64 sk_data_t* data = sk_image_encode(img0); 64 sk_data_t* data = sk_image_encode(img0);
65 sk_image_unref(img0); 65 sk_image_unref(img0);
66 66
67 sk_image_t* img1 = sk_image_new_from_data(data); 67 sk_image_t* img1 = sk_image_new_from_encoded(data, NULL);
68 sk_data_unref(data); 68 sk_data_unref(data);
69 69
70 if (img1) { 70 if (img1) {
71 sk_canvas_draw_image(canvas, img1, W/2, H/2, NULL); 71 sk_canvas_draw_image(canvas, img1, W/2, H/2, NULL);
72 sk_image_unref(img1); 72 sk_image_unref(img1);
73 } 73 }
74 } 74 }
75 75
76 76
OLDNEW
« no previous file with comments | « no previous file | gm/factory.cpp » ('j') | gm/factory.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698