OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkTileImageFilter.h" | 8 #include "SkTileImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 SkIRect* dst) const { | 86 SkIRect* dst) const { |
87 SkRect srcRect; | 87 SkRect srcRect; |
88 ctm.mapRect(&srcRect, fSrcRect); | 88 ctm.mapRect(&srcRect, fSrcRect); |
89 SkIRect srcIRect; | 89 SkIRect srcIRect; |
90 srcRect.roundOut(&srcIRect); | 90 srcRect.roundOut(&srcIRect); |
91 srcIRect.join(src); | 91 srcIRect.join(src); |
92 *dst = srcIRect; | 92 *dst = srcIRect; |
93 return true; | 93 return true; |
94 } | 94 } |
95 | 95 |
96 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING | |
97 SkTileImageFilter::SkTileImageFilter(SkReadBuffer& buffer) | |
98 : INHERITED(1, buffer) { | |
99 buffer.readRect(&fSrcRect); | |
100 buffer.readRect(&fDstRect); | |
101 buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect
(fDstRect)); | |
102 } | |
103 #endif | |
104 | |
105 SkFlattenable* SkTileImageFilter::CreateProc(SkReadBuffer& buffer) { | 96 SkFlattenable* SkTileImageFilter::CreateProc(SkReadBuffer& buffer) { |
106 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); | 97 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
107 SkRect src, dst; | 98 SkRect src, dst; |
108 buffer.readRect(&src); | 99 buffer.readRect(&src); |
109 buffer.readRect(&dst); | 100 buffer.readRect(&dst); |
110 return Create(src, dst, common.getInput(0), common.uniqueID()); | 101 return Create(src, dst, common.getInput(0), common.uniqueID()); |
111 } | 102 } |
112 | 103 |
113 void SkTileImageFilter::flatten(SkWriteBuffer& buffer) const { | 104 void SkTileImageFilter::flatten(SkWriteBuffer& buffer) const { |
114 this->INHERITED::flatten(buffer); | 105 this->INHERITED::flatten(buffer); |
115 buffer.writeRect(fSrcRect); | 106 buffer.writeRect(fSrcRect); |
116 buffer.writeRect(fDstRect); | 107 buffer.writeRect(fDstRect); |
117 } | 108 } |
OLD | NEW |