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

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

Issue 103033002: Big Cleanup: SkBitmapFactory, SkLazyPixelRef, SkImageCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase one last time Created 7 years 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/images/SkDecodingImageGenerator.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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 if (!bitmap->copyTo(&bm8888, SkBitmap::kARGB_8888_Config, &allocator)) { 380 if (!bitmap->copyTo(&bm8888, SkBitmap::kARGB_8888_Config, &allocator)) {
381 return false; 381 return false;
382 } 382 }
383 383
384 bitmap->swap(bm8888); 384 bitmap->swap(bm8888);
385 return true; 385 return true;
386 } 386 }
387 387
388 bool SkImageDecoder::DecodeMemoryToTarget(const void* buffer, size_t size, 388 bool SkImageDecoder::DecodeMemoryToTarget(const void* buffer, size_t size,
389 SkImageInfo* info, 389 SkImageInfo* info,
390 const SkBitmapFactory::Target* target) { 390 const SkImageDecoder::Target* target) {
391 // FIXME: Just to get this working, implement in terms of existing 391 // FIXME: Just to get this working, implement in terms of existing
392 // ImageDecoder calls. 392 // ImageDecoder calls.
393 SkBitmap bm; 393 SkBitmap bm;
394 SkMemoryStream stream(buffer, size); 394 SkMemoryStream stream(buffer, size);
395 SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(&stream)); 395 SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(&stream));
396 if (NULL == decoder.get()) { 396 if (NULL == decoder.get()) {
397 return false; 397 return false;
398 } 398 }
399 399
400 if (!decode_bounds_to_8888(decoder.get(), &stream, &bm)) { 400 if (!decode_bounds_to_8888(decoder.get(), &stream, &bm)) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if (kUnknown_Format == *format) { 445 if (kUnknown_Format == *format) {
446 if (stream->rewind()) { 446 if (stream->rewind()) {
447 *format = GetStreamFormat(stream); 447 *format = GetStreamFormat(stream);
448 } 448 }
449 } 449 }
450 } 450 }
451 delete codec; 451 delete codec;
452 } 452 }
453 return success; 453 return success;
454 } 454 }
OLDNEW
« no previous file with comments | « src/images/SkDecodingImageGenerator.cpp ('k') | src/lazy/SkBitmapFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698