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

Side by Side Diff: src/image/SkImage.cpp

Issue 54203006: Break up SkLazyPixelRef functionally into class hierarchy. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: last change 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/core/SkBitmap.cpp ('k') | src/lazy/SkCachingPixelRef.h » ('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 2012 Google Inc. 2 * Copyright 2012 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 "SkImagePriv.h" 10 #include "SkImagePriv.h"
11 #include "SkImage_Base.h" 11 #include "SkImage_Base.h"
12 12
13 SK_DEFINE_INST_COUNT(SkImage) 13 SK_DEFINE_INST_COUNT(SkImage)
14 14
15 bool operator==(const SkImageInfo& lhs, const SkImageInfo& rhs) {
16 return 0 == memcmp(&lhs, &rhs, sizeof(SkImageInfo));
17 }
18 bool operator!=(const SkImageInfo& lhs, const SkImageInfo& rhs) {
19 return 0 != memcmp(&lhs, &rhs, sizeof(SkImageInfo));
20 }
21
22
15 static SkImage_Base* as_IB(SkImage* image) { 23 static SkImage_Base* as_IB(SkImage* image) {
16 return static_cast<SkImage_Base*>(image); 24 return static_cast<SkImage_Base*>(image);
17 } 25 }
18 26
19 static const SkImage_Base* as_IB(const SkImage* image) { 27 static const SkImage_Base* as_IB(const SkImage* image) {
20 return static_cast<const SkImage_Base*>(image); 28 return static_cast<const SkImage_Base*>(image);
21 } 29 }
22 30
23 uint32_t SkImage::NextUniqueID() { 31 uint32_t SkImage::NextUniqueID() {
24 static int32_t gUniqueID; 32 static int32_t gUniqueID;
(...skipping 20 matching lines...) Expand all
45 return as_IB(this)->onGetTexture(); 53 return as_IB(this)->onGetTexture();
46 } 54 }
47 55
48 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { 56 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const {
49 SkBitmap bm; 57 SkBitmap bm;
50 if (as_IB(this)->getROPixels(&bm)) { 58 if (as_IB(this)->getROPixels(&bm)) {
51 return SkImageEncoder::EncodeData(bm, type, quality); 59 return SkImageEncoder::EncodeData(bm, type, quality);
52 } 60 }
53 return NULL; 61 return NULL;
54 } 62 }
OLDNEW
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/lazy/SkCachingPixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698