OLD | NEW |
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 "SkImageGenerator.h" | 10 #include "SkImageGenerator.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 } | 112 } |
113 | 113 |
114 if (NULL == subset && this->width() == newWidth && this->height() == newHeig
ht) { | 114 if (NULL == subset && this->width() == newWidth && this->height() == newHeig
ht) { |
115 return SkRef(const_cast<SkImage*>(this)); | 115 return SkRef(const_cast<SkImage*>(this)); |
116 } | 116 } |
117 | 117 |
118 return as_IB(this)->onNewImage(newWidth, newHeight, subset, quality); | 118 return as_IB(this)->onNewImage(newWidth, newHeight, subset, quality); |
119 } | 119 } |
120 | 120 |
| 121 void SkImage::preroll() const { |
| 122 as_IB(this)->onPreroll(); |
| 123 } |
| 124 |
121 /////////////////////////////////////////////////////////////////////////////// | 125 /////////////////////////////////////////////////////////////////////////////// |
122 | 126 |
123 static bool raster_canvas_supports(const SkImageInfo& info) { | 127 static bool raster_canvas_supports(const SkImageInfo& info) { |
124 switch (info.colorType()) { | 128 switch (info.colorType()) { |
125 case kN32_SkColorType: | 129 case kN32_SkColorType: |
126 return kUnpremul_SkAlphaType != info.alphaType(); | 130 return kUnpremul_SkAlphaType != info.alphaType(); |
127 case kRGB_565_SkColorType: | 131 case kRGB_565_SkColorType: |
128 return true; | 132 return true; |
129 case kAlpha_8_SkColorType: | 133 case kAlpha_8_SkColorType: |
130 return true; | 134 return true; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 surface->getCanvas()->translate(-src.x(), -src.y()); | 176 surface->getCanvas()->translate(-src.x(), -src.y()); |
173 | 177 |
174 SkPaint paint; | 178 SkPaint paint; |
175 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 179 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
176 paint.setFilterQuality(quality); | 180 paint.setFilterQuality(quality); |
177 surface->getCanvas()->drawImage(this, 0, 0, &paint); | 181 surface->getCanvas()->drawImage(this, 0, 0, &paint); |
178 return surface->newImageSnapshot(); | 182 return surface->newImageSnapshot(); |
179 } | 183 } |
180 | 184 |
181 | 185 |
OLD | NEW |