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

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

Issue 2252913004: Fix computation of clipped src rect when tiling bitmaps in SkGpuDevice (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 SkIRect* clippedSrcIRect) { 679 SkIRect* clippedSrcIRect) {
680 clip.getConservativeBounds(width, height, clippedSrcIRect, nullptr); 680 clip.getConservativeBounds(width, height, clippedSrcIRect, nullptr);
681 SkMatrix inv = SkMatrix::Concat(viewMatrix, srcToDstRect); 681 SkMatrix inv = SkMatrix::Concat(viewMatrix, srcToDstRect);
682 if (!inv.invert(&inv)) { 682 if (!inv.invert(&inv)) {
683 clippedSrcIRect->setEmpty(); 683 clippedSrcIRect->setEmpty();
684 return; 684 return;
685 } 685 }
686 SkRect clippedSrcRect = SkRect::Make(*clippedSrcIRect); 686 SkRect clippedSrcRect = SkRect::Make(*clippedSrcIRect);
687 inv.mapRect(&clippedSrcRect); 687 inv.mapRect(&clippedSrcRect);
688 if (srcRectPtr) { 688 if (srcRectPtr) {
689 // we've setup src space 0,0 to map to the top left of the src rect.
690 clippedSrcRect.offset(srcRectPtr->fLeft, srcRectPtr->fTop);
691 if (!clippedSrcRect.intersect(*srcRectPtr)) { 689 if (!clippedSrcRect.intersect(*srcRectPtr)) {
692 clippedSrcIRect->setEmpty(); 690 clippedSrcIRect->setEmpty();
693 return; 691 return;
694 } 692 }
695 } 693 }
696 clippedSrcRect.roundOut(clippedSrcIRect); 694 clippedSrcRect.roundOut(clippedSrcIRect);
697 SkIRect bmpBounds = SkIRect::MakeSize(imageSize); 695 SkIRect bmpBounds = SkIRect::MakeSize(imageSize);
698 if (!clippedSrcIRect->intersect(bmpBounds)) { 696 if (!clippedSrcIRect->intersect(bmpBounds)) {
699 clippedSrcIRect->setEmpty(); 697 clippedSrcIRect->setEmpty();
700 } 698 }
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1721 } 1719 }
1722 1720
1723 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { 1721 SkImageFilterCache* SkGpuDevice::getImageFilterCache() {
1724 ASSERT_SINGLE_OWNER 1722 ASSERT_SINGLE_OWNER
1725 // We always return a transient cache, so it is freed after each 1723 // We always return a transient cache, so it is freed after each
1726 // filter traversal. 1724 // filter traversal.
1727 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); 1725 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize);
1728 } 1726 }
1729 1727
1730 #endif 1728 #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