| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |