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

Side by Side Diff: src/core/SkConfig8888.cpp

Issue 2321673002: Add minimal support for readPixels in raster F16 (Closed)
Patch Set: Created 4 years, 3 months 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
« no previous file with comments | « no previous file | no next file » | 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 2014 Google Inc. 2 * Copyright 2014 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 "SkConfig8888.h" 10 #include "SkConfig8888.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // If they agree on colorType and the alphaTypes are compatible, then we jus t memcpy. 208 // If they agree on colorType and the alphaTypes are compatible, then we jus t memcpy.
209 // Note: we've already taken care of 32bit colortypes above. 209 // Note: we've already taken care of 32bit colortypes above.
210 if (srcInfo.colorType() == dstInfo.colorType()) { 210 if (srcInfo.colorType() == dstInfo.colorType()) {
211 switch (srcInfo.colorType()) { 211 switch (srcInfo.colorType()) {
212 case kRGB_565_SkColorType: 212 case kRGB_565_SkColorType:
213 case kAlpha_8_SkColorType: 213 case kAlpha_8_SkColorType:
214 case kGray_8_SkColorType: 214 case kGray_8_SkColorType:
215 break; 215 break;
216 case kIndex_8_SkColorType: 216 case kIndex_8_SkColorType:
217 case kARGB_4444_SkColorType: 217 case kARGB_4444_SkColorType:
218 case kRGBA_F16_SkColorType:
218 if (srcInfo.alphaType() != dstInfo.alphaType()) { 219 if (srcInfo.alphaType() != dstInfo.alphaType()) {
219 return false; 220 return false;
220 } 221 }
221 break; 222 break;
222 default: 223 default:
223 return false; 224 return false;
224 } 225 }
225 SkRectMemcpy(dstPixels, dstRB, srcPixels, srcRB, width * srcInfo.bytesPe rPixel(), height); 226 SkRectMemcpy(dstPixels, dstRB, srcPixels, srcRB, width * srcInfo.bytesPe rPixel(), height);
226 return true; 227 return true;
227 } 228 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 297 }
297 298
298 SkPaint paint; 299 SkPaint paint;
299 paint.setDither(true); 300 paint.setDither(true);
300 301
301 canvas->clear(0); 302 canvas->clear(0);
302 canvas->drawBitmap(bm, 0, 0, &paint); 303 canvas->drawBitmap(bm, 0, 0, &paint);
303 return true; 304 return true;
304 } 305 }
305 } 306 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698