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

Side by Side Diff: src/c/sk_surface.cpp

Issue 820343002: disable using codecs until that can work in chrome (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 12 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
« gm/cgm.c ('K') | « gm/cgm.c ('k') | no next file » | 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 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 #include "sk_canvas.h" 8 #include "sk_canvas.h"
9 #include "sk_data.h" 9 #include "sk_data.h"
10 #include "sk_image.h" 10 #include "sk_image.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 SkImageInfo info; 226 SkImageInfo info;
227 if (!from_c_info(*cinfo, &info)) { 227 if (!from_c_info(*cinfo, &info)) {
228 return NULL; 228 return NULL;
229 } 229 }
230 return (sk_image_t*)SkImage::NewRasterCopy(info, pixels, rowBytes); 230 return (sk_image_t*)SkImage::NewRasterCopy(info, pixels, rowBytes);
231 } 231 }
232 232
233 #include "SkDecodingImageGenerator.h" 233 #include "SkDecodingImageGenerator.h"
234 234
235 sk_image_t* sk_image_new_from_data(const sk_data_t* cdata) { 235 sk_image_t* sk_image_new_from_data(const sk_data_t* cdata) {
236 SkImageGenerator* gen = SkDecodingImageGenerator::Create(AsData(cdata), 236 SkImageGenerator* gen = NULL;
237 SkDecodingImageGene rator::Options()); 237 #if 0
scroggo 2014/12/30 11:14:33 Can we use a macro here to only behave this way if
reed1 2015/01/05 16:04:59 The #if 0 is meant to be (very) temporary, as I ho
238 // enable this when SkDecodingImageGenerator is available in chrome (decode codecs)
239 gen = SkDecodingImageGenerator::Create(AsData(cdata), SkDecodingImageGenerat or::Options());
240 #endif
238 if (NULL == gen) { 241 if (NULL == gen) {
239 return NULL; 242 return NULL;
240 } 243 }
241 return ToImage(SkImage::NewFromGenerator(gen)); 244 return ToImage(SkImage::NewFromGenerator(gen));
242 } 245 }
243 246
244 sk_data_t* sk_image_encode(const sk_image_t* cimage) { 247 sk_data_t* sk_image_encode(const sk_image_t* cimage) {
245 return ToData(AsImage(cimage)->encode()); 248 return ToData(AsImage(cimage)->encode());
246 } 249 }
247 250
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 sk_image_t* cimage = sk_surface_new_image_snapshot(csurface); 690 sk_image_t* cimage = sk_surface_new_image_snapshot(csurface);
688 691
689 // HERE WE CROSS THE C..C++ boundary 692 // HERE WE CROSS THE C..C++ boundary
690 canvas->drawImage((const SkImage*)cimage, 20, 20, NULL); 693 canvas->drawImage((const SkImage*)cimage, 20, 20, NULL);
691 694
692 sk_path_delete(cpath); 695 sk_path_delete(cpath);
693 sk_paint_delete(cpaint); 696 sk_paint_delete(cpaint);
694 sk_image_unref(cimage); 697 sk_image_unref(cimage);
695 sk_surface_unref(csurface); 698 sk_surface_unref(csurface);
696 } 699 }
OLDNEW
« gm/cgm.c ('K') | « gm/cgm.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698