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

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 1584073007: fix SkGpuDevice::drawBitmapRect to always update clips (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 11 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 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "GrBlurUtils.h" 10 #include "GrBlurUtils.h"
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 SkRect::MakeXYWH(0, 1216 SkRect::MakeXYWH(0,
1217 0, 1217 0,
1218 SK_Scalar1 * w / texture->widt h(), 1218 SK_Scalar1 * w / texture->widt h(),
1219 SK_Scalar1 * h / texture->heig ht())); 1219 SK_Scalar1 * h / texture->heig ht()));
1220 } 1220 }
1221 1221
1222 void SkGpuDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, 1222 void SkGpuDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
1223 const SkRect* src, const SkRect& origDst, 1223 const SkRect* src, const SkRect& origDst,
1224 const SkPaint& paint, SkCanvas::SrcRectConstrai nt constraint) { 1224 const SkPaint& paint, SkCanvas::SrcRectConstrai nt constraint) {
1225 ASSERT_SINGLE_OWNER 1225 ASSERT_SINGLE_OWNER
1226 CHECK_SHOULD_DRAW(draw);
1226 if (bitmap.getTexture()) { 1227 if (bitmap.getTexture()) {
1227 CHECK_SHOULD_DRAW(draw);
1228 GrBitmapTextureAdjuster adjuster(&bitmap); 1228 GrBitmapTextureAdjuster adjuster(&bitmap);
1229 this->drawTextureProducer(&adjuster, src, &origDst, constraint, *draw.fM atrix, fClip, 1229 this->drawTextureProducer(&adjuster, src, &origDst, constraint, *draw.fM atrix, fClip,
1230 paint); 1230 paint);
1231 return; 1231 return;
1232 } 1232 }
1233 // The src rect is inferred to be the bmp bounds if not provided. Otherwise, the src rect must 1233 // The src rect is inferred to be the bmp bounds if not provided. Otherwise, the src rect must
1234 // be clipped to the bmp bounds. To determine tiling parameters we need the filter mode which 1234 // be clipped to the bmp bounds. To determine tiling parameters we need the filter mode which
1235 // in turn requires knowing the src-to-dst mapping. If the src was clipped t o the bmp bounds 1235 // in turn requires knowing the src-to-dst mapping. If the src was clipped t o the bmp bounds
1236 // then we use the src-to-dst mapping to compute a new clipped dst rect. 1236 // then we use the src-to-dst mapping to compute a new clipped dst rect.
1237 const SkRect* dst = &origDst; 1237 const SkRect* dst = &origDst;
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
1908 } 1908 }
1909 1909
1910 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 1910 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
1911 ASSERT_SINGLE_OWNER 1911 ASSERT_SINGLE_OWNER
1912 // We always return a transient cache, so it is freed after each 1912 // We always return a transient cache, so it is freed after each
1913 // filter traversal. 1913 // filter traversal.
1914 return SkGpuDevice::NewImageFilterCache(); 1914 return SkGpuDevice::NewImageFilterCache();
1915 } 1915 }
1916 1916
1917 #endif 1917 #endif
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