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

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

Issue 2241273003: Attempt to throw away rrect clips of rrects. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: fix int to scalar warnings 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 | « src/gpu/GrClipStackClip.h ('k') | src/gpu/GrDrawContext.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 2016 Google Inc. 2 * Copyright 2016 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 "GrClipStackClip.h" 8 #include "GrClipStackClip.h"
9 9
10 #include "GrDrawingManager.h" 10 #include "GrDrawingManager.h"
(...skipping 12 matching lines...) Expand all
23 static const int kMaxAnalyticElements = 4; 23 static const int kMaxAnalyticElements = 4;
24 24
25 bool GrClipStackClip::quickContains(const SkRect& rect) const { 25 bool GrClipStackClip::quickContains(const SkRect& rect) const {
26 if (!fStack) { 26 if (!fStack) {
27 return true; 27 return true;
28 } 28 }
29 return fStack->quickContains(rect.makeOffset(SkIntToScalar(fOrigin.x()), 29 return fStack->quickContains(rect.makeOffset(SkIntToScalar(fOrigin.x()),
30 SkIntToScalar(fOrigin.y()))); 30 SkIntToScalar(fOrigin.y())));
31 } 31 }
32 32
33 bool GrClipStackClip::quickContains(const SkRRect& rrect) const {
34 if (!fStack) {
35 return true;
36 }
37 return fStack->quickContains(rrect.makeOffset(SkIntToScalar(fOrigin.fX),
38 SkIntToScalar(fOrigin.fY)));
39 }
40
33 void GrClipStackClip::getConservativeBounds(int width, int height, SkIRect* devR esult, 41 void GrClipStackClip::getConservativeBounds(int width, int height, SkIRect* devR esult,
34 bool* isIntersectionOfRects) const { 42 bool* isIntersectionOfRects) const {
35 if (!fStack) { 43 if (!fStack) {
36 devResult->setXYWH(0, 0, width, height); 44 devResult->setXYWH(0, 0, width, height);
37 if (isIntersectionOfRects) { 45 if (isIntersectionOfRects) {
38 *isIntersectionOfRects = true; 46 *isIntersectionOfRects = true;
39 } 47 }
40 return; 48 return;
41 } 49 }
42 SkRect devBounds; 50 SkRect devBounds;
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc)); 763 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc));
756 if (!result) { 764 if (!result) {
757 return nullptr; 765 return nullptr;
758 } 766 }
759 result->resourcePriv().setUniqueKey(key); 767 result->resourcePriv().setUniqueKey(key);
760 768
761 helper.toTexture(result.get()); 769 helper.toTexture(result.get());
762 770
763 return result; 771 return result;
764 } 772 }
OLDNEW
« no previous file with comments | « src/gpu/GrClipStackClip.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698