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 "GrLayerCache.h" | 8 #include "GrLayerCache.h" |
9 #include "GrLayerHoister.h" | 9 #include "GrLayerHoister.h" |
10 #include "GrRecordReplaceDraw.h" | 10 #include "GrRecordReplaceDraw.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Compute the source rect and return false if it is empty. | 86 // Compute the source rect and return false if it is empty. |
87 static bool compute_source_rect(const SkLayerInfo::BlockInfo& info, const SkMatr
ix& initialMat, | 87 static bool compute_source_rect(const SkLayerInfo::BlockInfo& info, const SkMatr
ix& initialMat, |
88 const SkIRect& dstIR, SkIRect* srcIR) { | 88 const SkIRect& dstIR, SkIRect* srcIR) { |
89 SkIRect clipBounds = dstIR; | 89 SkIRect clipBounds = dstIR; |
90 | 90 |
91 SkMatrix totMat = initialMat; | 91 SkMatrix totMat = initialMat; |
92 totMat.preConcat(info.fPreMat); | 92 totMat.preConcat(info.fPreMat); |
93 totMat.preConcat(info.fLocalMat); | 93 totMat.preConcat(info.fLocalMat); |
94 | 94 |
95 if (info.fPaint && info.fPaint->getImageFilter()) { | 95 if (info.fPaint && info.fPaint->getImageFilter()) { |
96 info.fPaint->getImageFilter()->filterBounds(clipBounds, totMat, &clipBou
nds); | 96 clipBounds = info.fPaint->getImageFilter()->filterBounds(clipBounds, tot
Mat); |
97 } | 97 } |
98 | 98 |
99 if (!info.fSrcBounds.isEmpty()) { | 99 if (!info.fSrcBounds.isEmpty()) { |
100 SkRect r; | 100 SkRect r; |
101 | 101 |
102 totMat.mapRect(&r, info.fSrcBounds); | 102 totMat.mapRect(&r, info.fSrcBounds); |
103 r.roundOut(srcIR); | 103 r.roundOut(srcIR); |
104 | 104 |
105 if (!srcIR->intersect(clipBounds)) { | 105 if (!srcIR->intersect(clipBounds)) { |
106 return false; | 106 return false; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 #if !GR_CACHE_HOISTED_LAYERS | 388 #if !GR_CACHE_HOISTED_LAYERS |
389 | 389 |
390 // This code completely clears out the atlas. It is required when | 390 // This code completely clears out the atlas. It is required when |
391 // caching is disabled so the atlas doesn't fill up and force more | 391 // caching is disabled so the atlas doesn't fill up and force more |
392 // free floating layers | 392 // free floating layers |
393 layerCache->purgeAll(); | 393 layerCache->purgeAll(); |
394 #endif | 394 #endif |
395 | 395 |
396 layerCache->end(); | 396 layerCache->end(); |
397 } | 397 } |
OLD | NEW |