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 | |
125 /////////////////////////////////////////////////////////////////////////////// | 121 /////////////////////////////////////////////////////////////////////////////// |
126 | 122 |
127 static bool raster_canvas_supports(const SkImageInfo& info) { | 123 static bool raster_canvas_supports(const SkImageInfo& info) { |
128 switch (info.colorType()) { | 124 switch (info.colorType()) { |
129 case kN32_SkColorType: | 125 case kN32_SkColorType: |
130 return kUnpremul_SkAlphaType != info.alphaType(); | 126 return kUnpremul_SkAlphaType != info.alphaType(); |
131 case kRGB_565_SkColorType: | 127 case kRGB_565_SkColorType: |
132 return true; | 128 return true; |
133 case kAlpha_8_SkColorType: | 129 case kAlpha_8_SkColorType: |
134 return true; | 130 return true; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 surface->getCanvas()->translate(-src.x(), -src.y()); | 172 surface->getCanvas()->translate(-src.x(), -src.y()); |
177 | 173 |
178 SkPaint paint; | 174 SkPaint paint; |
179 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 175 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
180 paint.setFilterQuality(quality); | 176 paint.setFilterQuality(quality); |
181 surface->getCanvas()->drawImage(this, 0, 0, &paint); | 177 surface->getCanvas()->drawImage(this, 0, 0, &paint); |
182 return surface->newImageSnapshot(); | 178 return surface->newImageSnapshot(); |
183 } | 179 } |
184 | 180 |
185 | 181 |
OLD | NEW |