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

Side by Side Diff: src/images/SkImageDecoder.cpp

Issue 1422703009: Revert[4] of "stop using drawSprite (at least w/ no filters) as it is going away" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 | « src/gpu/GrRecordReplaceDraw.cpp ('k') | 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 2006 The Android Open Source Project 2 * Copyright 2006 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 8
9 #include "SkImageDecoder.h" 9 #include "SkImageDecoder.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 if (dst->width() < w || dst->height() < h) { 199 if (dst->width() < w || dst->height() < h) {
200 SkDEBUGF(("SkImageDecoder::cropBitmap does not have a large enough bitma p.\n")); 200 SkDEBUGF(("SkImageDecoder::cropBitmap does not have a large enough bitma p.\n"));
201 } 201 }
202 202
203 // Set the Src_Mode for the paint to prevent transparency issue in the 203 // Set the Src_Mode for the paint to prevent transparency issue in the
204 // dest in the event that the dest was being re-used. 204 // dest in the event that the dest was being re-used.
205 SkPaint paint; 205 SkPaint paint;
206 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 206 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
207 207
208 SkCanvas canvas(*dst); 208 SkCanvas canvas(*dst);
209 canvas.drawSprite(*src, (srcX - dstX) / sampleSize, 209 canvas.drawBitmap(*src, SkIntToScalar((srcX - dstX) / sampleSize),
210 (srcY - dstY) / sampleSize, 210 SkIntToScalar((srcY - dstY) / sampleSize),
211 &paint); 211 &paint);
212 return true; 212 return true;
213 } 213 }
214 214
215 /////////////////////////////////////////////////////////////////////////////// 215 ///////////////////////////////////////////////////////////////////////////////
216 216
217 bool SkImageDecoder::DecodeFile(const char file[], SkBitmap* bm, SkColorType pre f, Mode mode, 217 bool SkImageDecoder::DecodeFile(const char file[], SkBitmap* bm, SkColorType pre f, Mode mode,
218 Format* format) { 218 Format* format) {
219 SkASSERT(file); 219 SkASSERT(file);
220 SkASSERT(bm); 220 SkASSERT(bm);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 return success; 265 return success;
266 } 266 }
267 267
268 bool SkImageDecoder::decodeYUV8Planes(SkStream* stream, SkISize componentSizes[3 ], void* planes[3], 268 bool SkImageDecoder::decodeYUV8Planes(SkStream* stream, SkISize componentSizes[3 ], void* planes[3],
269 size_t rowBytes[3], SkYUVColorSpace* color Space) { 269 size_t rowBytes[3], SkYUVColorSpace* color Space) {
270 // we reset this to false before calling onDecodeYUV8Planes 270 // we reset this to false before calling onDecodeYUV8Planes
271 fShouldCancelDecode = false; 271 fShouldCancelDecode = false;
272 272
273 return this->onDecodeYUV8Planes(stream, componentSizes, planes, rowBytes, co lorSpace); 273 return this->onDecodeYUV8Planes(stream, componentSizes, planes, rowBytes, co lorSpace);
274 } 274 }
OLDNEW
« no previous file with comments | « src/gpu/GrRecordReplaceDraw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698