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

Side by Side Diff: src/images/SkImageDecoder.cpp

Issue 54363008: move SkImage::ColorType into SkColorType (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/image/SkSurface_Raster.cpp ('k') | src/lazy/SkBitmapFactory.cpp » ('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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 8
9 #include "SkImageDecoder.h" 9 #include "SkImageDecoder.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 SkBitmap bm8888; 396 SkBitmap bm8888;
397 if (!bitmap->copyTo(&bm8888, SkBitmap::kARGB_8888_Config, &allocator)) { 397 if (!bitmap->copyTo(&bm8888, SkBitmap::kARGB_8888_Config, &allocator)) {
398 return false; 398 return false;
399 } 399 }
400 400
401 bitmap->swap(bm8888); 401 bitmap->swap(bm8888);
402 return true; 402 return true;
403 } 403 }
404 404
405 bool SkImageDecoder::DecodeMemoryToTarget(const void* buffer, size_t size, 405 bool SkImageDecoder::DecodeMemoryToTarget(const void* buffer, size_t size,
406 SkImage::Info* info, 406 SkImageInfo* info,
407 const SkBitmapFactory::Target* target) { 407 const SkBitmapFactory::Target* target) {
408 // FIXME: Just to get this working, implement in terms of existing 408 // FIXME: Just to get this working, implement in terms of existing
409 // ImageDecoder calls. 409 // ImageDecoder calls.
410 SkBitmap bm; 410 SkBitmap bm;
411 SkMemoryStream stream(buffer, size); 411 SkMemoryStream stream(buffer, size);
412 SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(&stream)); 412 SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(&stream));
413 if (NULL == decoder.get()) { 413 if (NULL == decoder.get()) {
414 return false; 414 return false;
415 } 415 }
416 416
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 if (kUnknown_Format == *format) { 462 if (kUnknown_Format == *format) {
463 if (stream->rewind()) { 463 if (stream->rewind()) {
464 *format = GetStreamFormat(stream); 464 *format = GetStreamFormat(stream);
465 } 465 }
466 } 466 }
467 } 467 }
468 delete codec; 468 delete codec;
469 } 469 }
470 return success; 470 return success;
471 } 471 }
OLDNEW
« no previous file with comments | « src/image/SkSurface_Raster.cpp ('k') | src/lazy/SkBitmapFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698