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

Side by Side Diff: tests/CachedDecodingPixelRefTest.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/ports/SkImageDecoder_empty.cpp ('k') | tests/DeferredCanvasTest.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 2013 Google Inc. 2 * Copyright 2013 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 return NULL; 49 return NULL;
50 } 50 }
51 51
52 /** 52 /**
53 * A simplified version of SkBitmapFactory 53 * A simplified version of SkBitmapFactory
54 */ 54 */
55 static bool simple_bitmap_factory(SkBitmapFactory::DecodeProc proc, 55 static bool simple_bitmap_factory(SkBitmapFactory::DecodeProc proc,
56 SkData* data, 56 SkData* data,
57 SkBitmap* dst) { 57 SkBitmap* dst) {
58 SkImage::Info info; 58 SkImageInfo info;
59 if (!proc(data->data(), data->size(), &info, NULL)) { 59 if (!proc(data->data(), data->size(), &info, NULL)) {
60 return false; 60 return false;
61 } 61 }
62 dst->setConfig(SkImageInfoToBitmapConfig(info), info.fWidth, 62 dst->setConfig(SkImageInfoToBitmapConfig(info), info.fWidth,
63 info.fHeight, 0, info.fAlphaType); 63 info.fHeight, 0, info.fAlphaType);
64 SkAutoTUnref<SkLazyPixelRef> ref(SkNEW_ARGS(SkLazyPixelRef, 64 SkAutoTUnref<SkLazyPixelRef> ref(SkNEW_ARGS(SkLazyPixelRef,
65 (data, proc, NULL))); 65 (data, proc, NULL)));
66 dst->setPixelRef(ref); 66 dst->setPixelRef(ref);
67 return true; 67 return true;
68 } 68 }
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 // // verify that *different* pixels are used this time. 194 // // verify that *different* pixels are used this time.
195 // REPORTER_ASSERT(reporter, lazy.getPixels() != lazyPixels); 195 // REPORTER_ASSERT(reporter, lazy.getPixels() != lazyPixels);
196 // compare_bitmaps(reporter, original, lazy, comparePixels); 196 // compare_bitmaps(reporter, original, lazy, comparePixels);
197 // } 197 // }
198 // } 198 // }
199 199
200 // restore cache size 200 // restore cache size
201 SkScaledImageCache::SetByteLimit(oldByteLimit); 201 SkScaledImageCache::SetByteLimit(oldByteLimit);
202 } 202 }
203 } 203 }
OLDNEW
« no previous file with comments | « src/ports/SkImageDecoder_empty.cpp ('k') | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698