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

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

Issue 1495693003: Index8 GPU and CPU raster support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: revert SkImageGenerator&SkImageCacherator changes. Created 5 years 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 | « gyp/gpu.gypi ('k') | src/gpu/SkGr.cpp » ('j') | 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 2013 Google Inc. 2 * Copyright 2013 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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkConfig8888.h" 9 #include "SkConfig8888.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 } else { 263 } else {
264 tmpSrc = bitmapBounds; 264 tmpSrc = bitmapBounds;
265 } 265 }
266 matrix.setRectToRect(tmpSrc, dst, SkMatrix::kFill_ScaleToFit); 266 matrix.setRectToRect(tmpSrc, dst, SkMatrix::kFill_ScaleToFit);
267 267
268 const SkRect* dstPtr = &dst; 268 const SkRect* dstPtr = &dst;
269 const SkBitmap* bitmapPtr = &bitmap; 269 const SkBitmap* bitmapPtr = &bitmap;
270 270
271 // clip the tmpSrc to the bounds of the bitmap, and recompute dstRect if 271 // clip the tmpSrc to the bounds of the bitmap, and recompute dstRect if
272 // needed (if the src was clipped). No check needed if src==null. 272 // needed (if the src was clipped). No check needed if src==null.
273 if (src) { 273 // If bitmapBounds are the same as src, go faster path bellow.
274 if (src && !(bitmapBounds == *src)) {
274 if (!bitmapBounds.contains(*src)) { 275 if (!bitmapBounds.contains(*src)) {
275 if (!tmpSrc.intersect(bitmapBounds)) { 276 if (!tmpSrc.intersect(bitmapBounds)) {
276 return; // nothing to draw 277 return; // nothing to draw
277 } 278 }
278 // recompute dst, based on the smaller tmpSrc 279 // recompute dst, based on the smaller tmpSrc
279 matrix.mapRect(&tmpDst, tmpSrc); 280 matrix.mapRect(&tmpDst, tmpSrc);
280 dstPtr = &tmpDst; 281 dstPtr = &tmpDst;
281 } 282 }
282 283
283 // since we may need to clamp to the borders of the src rect within 284 // since we may need to clamp to the borders of the src rect within
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 paint.getRasterizer() || 388 paint.getRasterizer() ||
388 paint.getPathEffect() || 389 paint.getPathEffect() ||
389 paint.isFakeBoldText() || 390 paint.isFakeBoldText() ||
390 paint.getStyle() != SkPaint::kFill_Style || 391 paint.getStyle() != SkPaint::kFill_Style ||
391 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) 392 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode))
392 { 393 {
393 return true; 394 return true;
394 } 395 }
395 return false; 396 return false;
396 } 397 }
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698