OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkImageSource.h" | 8 #include "SkImageSource.h" |
9 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
11 #include "SkImage.h" | 11 #include "SkImage.h" |
12 #include "SkReadBuffer.h" | 12 #include "SkReadBuffer.h" |
13 #include "SkSpecialImage.h" | 13 #include "SkSpecialImage.h" |
14 #include "SkSpecialSurface.h" | 14 #include "SkSpecialSurface.h" |
15 #include "SkWriteBuffer.h" | 15 #include "SkWriteBuffer.h" |
16 #include "SkString.h" | 16 #include "SkString.h" |
17 | 17 |
18 | 18 |
19 SkImageSource::SkImageSource(sk_sp<SkImage> image) | 19 SkImageSource::SkImageSource(sk_sp<SkImage> image) |
20 : INHERITED(0, nullptr) | 20 : INHERITED(nullptr, 0, nullptr) |
21 , fImage(std::move(image)) | 21 , fImage(std::move(image)) |
22 , fSrcRect(SkRect::MakeIWH(fImage->width(), fImage->height())) | 22 , fSrcRect(SkRect::MakeIWH(fImage->width(), fImage->height())) |
23 , fDstRect(fSrcRect) | 23 , fDstRect(fSrcRect) |
24 , fFilterQuality(kHigh_SkFilterQuality) { | 24 , fFilterQuality(kHigh_SkFilterQuality) { |
25 } | 25 } |
26 | 26 |
27 SkImageSource::SkImageSource(sk_sp<SkImage> image, | 27 SkImageSource::SkImageSource(sk_sp<SkImage> image, |
28 const SkRect& srcRect, | 28 const SkRect& srcRect, |
29 const SkRect& dstRect, | 29 const SkRect& dstRect, |
30 SkFilterQuality filterQuality) | 30 SkFilterQuality filterQuality) |
31 : INHERITED(0, nullptr) | 31 : INHERITED(nullptr, 0, nullptr) |
32 , fImage(std::move(image)) | 32 , fImage(std::move(image)) |
33 , fSrcRect(srcRect) | 33 , fSrcRect(srcRect) |
34 , fDstRect(dstRect) | 34 , fDstRect(dstRect) |
35 , fFilterQuality(filterQuality) { | 35 , fFilterQuality(filterQuality) { |
36 } | 36 } |
37 | 37 |
38 sk_sp<SkFlattenable> SkImageSource::CreateProc(SkReadBuffer& buffer) { | 38 sk_sp<SkFlattenable> SkImageSource::CreateProc(SkReadBuffer& buffer) { |
39 SkFilterQuality filterQuality = (SkFilterQuality)buffer.readInt(); | 39 SkFilterQuality filterQuality = (SkFilterQuality)buffer.readInt(); |
40 | 40 |
41 SkRect src, dst; | 41 SkRect src, dst; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 void SkImageSource::toString(SkString* str) const { | 115 void SkImageSource::toString(SkString* str) const { |
116 str->appendf("SkImageSource: ("); | 116 str->appendf("SkImageSource: ("); |
117 str->appendf("src: (%f,%f,%f,%f) dst: (%f,%f,%f,%f) ", | 117 str->appendf("src: (%f,%f,%f,%f) dst: (%f,%f,%f,%f) ", |
118 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto
m, | 118 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto
m, |
119 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto
m); | 119 fDstRect.fLeft, fDstRect.fTop, fDstRect.fRight, fDstRect.fBotto
m); |
120 str->appendf("image: (%d,%d)", | 120 str->appendf("image: (%d,%d)", |
121 fImage->width(), fImage->height()); | 121 fImage->width(), fImage->height()); |
122 str->append(")"); | 122 str->append(")"); |
123 } | 123 } |
124 #endif | 124 #endif |
OLD | NEW |