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

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

Issue 2196803002: If scissor would be empty in GrClipMaskManager::SetupClipping indicate draw can be skipped. (Closed) Base URL: https://skia.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 2012 Google Inc. 2 * Copyright 2012 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 "GrClipMaskManager.h" 8 #include "GrClipMaskManager.h"
9 #include "GrCaps.h" 9 #include "GrCaps.h"
10 #include "GrDrawingManager.h" 10 #include "GrDrawingManager.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 SkIRect clipSpaceIBounds; 251 SkIRect clipSpaceIBounds;
252 bool requiresAA = false; 252 bool requiresAA = false;
253 253
254 InitialState initialState = GrReducedClip::ReduceClipStack(*clip.clipStack() , 254 InitialState initialState = GrReducedClip::ReduceClipStack(*clip.clipStack() ,
255 devBounds.makeOff set(clipX, clipY), 255 devBounds.makeOff set(clipX, clipY),
256 &elements, 256 &elements,
257 &genID, 257 &genID,
258 &clipSpaceIBounds , 258 &clipSpaceIBounds ,
259 &requiresAA); 259 &requiresAA);
260 if (elements.isEmpty()) { 260 if (elements.isEmpty()) {
261 if (GrReducedClip::kAllOut_InitialState == initialState) { 261 if (GrReducedClip::kAllOut_InitialState == initialState || clipSpaceIBou nds.isEmpty()) {
262 return false; 262 return false;
263 } else { 263 } else {
264 SkIRect scissorSpaceIBounds(clipSpaceIBounds); 264 SkIRect scissorSpaceIBounds(clipSpaceIBounds);
265 scissorSpaceIBounds.offset(-clip.origin()); 265 scissorSpaceIBounds.offset(-clip.origin());
266 if (!GrClip::IsInsideClip(scissorSpaceIBounds, devBounds)) { 266 if (!GrClip::IsInsideClip(scissorSpaceIBounds, devBounds)) {
267 out->makeScissored(scissorSpaceIBounds); 267 out->makeScissored(scissorSpaceIBounds);
268 } 268 }
269 return true; 269 return true;
270 } 270 }
271 } 271 }
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc)); 801 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc));
802 if (!result) { 802 if (!result) {
803 return nullptr; 803 return nullptr;
804 } 804 }
805 result->resourcePriv().setUniqueKey(key); 805 result->resourcePriv().setUniqueKey(key);
806 806
807 helper.toTexture(result.get()); 807 helper.toTexture(result.get());
808 808
809 return result; 809 return result;
810 } 810 }
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