OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 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 #include "SkBitmapSource.h" | 8 #include "SkBitmapSource.h" |
9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 SkFilterQuality filterQuality) | 26 SkFilterQuality filterQuality) |
27 : INHERITED(0, 0) | 27 : INHERITED(0, 0) |
28 , fBitmap(bitmap) | 28 , fBitmap(bitmap) |
29 , fSrcRect(srcRect) | 29 , fSrcRect(srcRect) |
30 , fDstRect(dstRect) | 30 , fDstRect(dstRect) |
31 , fFilterQuality(filterQuality) { | 31 , fFilterQuality(filterQuality) { |
32 } | 32 } |
33 | 33 |
34 SkFlattenable* SkBitmapSource::CreateProc(SkReadBuffer& buffer) { | 34 SkFlattenable* SkBitmapSource::CreateProc(SkReadBuffer& buffer) { |
35 SkFilterQuality filterQuality; | 35 SkFilterQuality filterQuality; |
36 if (buffer.isVersionLT(SkReadBuffer::kBitmapourceFilterQuality_Version)) { | 36 if (buffer.isVersionLT(SkReadBuffer::kBitmapSourceFilterQuality_Version)) { |
37 filterQuality = kHigh_SkFilterQuality; | 37 filterQuality = kHigh_SkFilterQuality; |
38 } else { | 38 } else { |
39 filterQuality = (SkFilterQuality)buffer.readInt(); | 39 filterQuality = (SkFilterQuality)buffer.readInt(); |
40 } | 40 } |
41 SkRect src, dst; | 41 SkRect src, dst; |
42 buffer.readRect(&src); | 42 buffer.readRect(&src); |
43 buffer.readRect(&dst); | 43 buffer.readRect(&dst); |
44 SkBitmap bitmap; | 44 SkBitmap bitmap; |
45 if (!buffer.readBitmap(&bitmap)) { | 45 if (!buffer.readBitmap(&bitmap)) { |
46 return NULL; | 46 return NULL; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 void SkBitmapSource::toString(SkString* str) const { | 101 void SkBitmapSource::toString(SkString* str) const { |
102 str->appendf("SkBitmapSource: ("); | 102 str->appendf("SkBitmapSource: ("); |
103 str->appendf("src: (%f,%f,%f,%f) dst: (%f,%f,%f,%f) ", | 103 str->appendf("src: (%f,%f,%f,%f) dst: (%f,%f,%f,%f) ", |
104 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto
m, | 104 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto
m, |
105 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto
m); | 105 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto
m); |
106 str->appendf("bitmap: (%d,%d)", | 106 str->appendf("bitmap: (%d,%d)", |
107 fBitmap.width(), fBitmap.height()); | 107 fBitmap.width(), fBitmap.height()); |
108 str->append(")"); | 108 str->append(")"); |
109 } | 109 } |
110 #endif | 110 #endif |
OLD | NEW |