| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkLayerInfo.h" | 8 #include "SkLayerInfo.h" |
| 9 #include "SkRecordDraw.h" | 9 #include "SkRecordDraw.h" |
| 10 #include "SkPatchUtils.h" | 10 #include "SkPatchUtils.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 if (!this->adjustForSaveLayerPaints(&rect)) { | 213 if (!this->adjustForSaveLayerPaints(&rect)) { |
| 214 // Same deal as above. | 214 // Same deal as above. |
| 215 return fCurrentClipBounds; | 215 return fCurrentClipBounds; |
| 216 } | 216 } |
| 217 | 217 |
| 218 // Map the rect back to identity space. | 218 // Map the rect back to identity space. |
| 219 fCTM->mapRect(&rect); | 219 fCTM->mapRect(&rect); |
| 220 | 220 |
| 221 // Nothing can draw outside the current clip. | 221 // Nothing can draw outside the current clip. |
| 222 // (Only bounded ops call into this method, so oddballs like Clear don't
matter here.) | 222 // (Only bounded ops call into this method, so oddballs like Clear don't
matter here.) |
| 223 rect.intersect(fCurrentClipBounds); | 223 if (!rect.intersect(fCurrentClipBounds)) { |
| 224 return Bounds::MakeEmpty(); |
| 225 } |
| 226 |
| 224 return rect; | 227 return rect; |
| 225 } | 228 } |
| 226 | 229 |
| 227 private: | 230 private: |
| 228 struct SaveBounds { | 231 struct SaveBounds { |
| 229 int controlOps; // Number of control ops in this Save block, incl
uding the Save. | 232 int controlOps; // Number of control ops in this Save block, incl
uding the Save. |
| 230 Bounds bounds; // Bounds of everything in the block. | 233 Bounds bounds; // Bounds of everything in the block. |
| 231 const SkPaint* paint; // Unowned. If set, adjusts the bounds of all op
s in this block. | 234 const SkPaint* paint; // Unowned. If set, adjusts the bounds of all op
s in this block. |
| 232 }; | 235 }; |
| 233 | 236 |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); | 794 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); |
| 792 | 795 |
| 793 for (unsigned curOp = 0; curOp < record.count(); curOp++) { | 796 for (unsigned curOp = 0; curOp < record.count(); curOp++) { |
| 794 visitor.setCurrentOp(curOp); | 797 visitor.setCurrentOp(curOp); |
| 795 record.visit<void>(curOp, visitor); | 798 record.visit<void>(curOp, visitor); |
| 796 } | 799 } |
| 797 | 800 |
| 798 visitor.cleanUp(bbh); | 801 visitor.cleanUp(bbh); |
| 799 } | 802 } |
| 800 | 803 |
| OLD | NEW |