| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrInOrderDrawBuffer.h" | 8 #include "GrInOrderDrawBuffer.h" |
| 9 | 9 |
| 10 #include "GrBufferAllocPool.h" | 10 #include "GrBufferAllocPool.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 if (kUnknown_ClipProxyState == fClipProxyState) { | 206 if (kUnknown_ClipProxyState == fClipProxyState) { |
| 207 SkIRect rect; | 207 SkIRect rect; |
| 208 bool iior; | 208 bool iior; |
| 209 this->getClip()->getConservativeBounds(this->getDrawState().getRenderTar
get(), &rect, &iior); | 209 this->getClip()->getConservativeBounds(this->getDrawState().getRenderTar
get(), &rect, &iior); |
| 210 if (iior) { | 210 if (iior) { |
| 211 // The clip is a rect. We will remember that in fProxyClip. It is co
mmon for an edge (or | 211 // The clip is a rect. We will remember that in fProxyClip. It is co
mmon for an edge (or |
| 212 // all edges) of the clip to be at the edge of the RT. However, we g
et that clipping for | 212 // all edges) of the clip to be at the edge of the RT. However, we g
et that clipping for |
| 213 // free via the viewport. We don't want to think that clipping must
be enabled in this | 213 // free via the viewport. We don't want to think that clipping must
be enabled in this |
| 214 // case. So we extend the clip outward from the edge to avoid these
false negatives. | 214 // case. So we extend the clip outward from the edge to avoid these
false negatives. |
| 215 fClipProxyState = kValid_ClipProxyState; | 215 fClipProxyState = kValid_ClipProxyState; |
| 216 fClipProxy = SkRect::MakeFromIRect(rect); | 216 fClipProxy = SkRect::Make(rect); |
| 217 | 217 |
| 218 if (fClipProxy.fLeft <= 0) { | 218 if (fClipProxy.fLeft <= 0) { |
| 219 fClipProxy.fLeft = SK_ScalarMin; | 219 fClipProxy.fLeft = SK_ScalarMin; |
| 220 } | 220 } |
| 221 if (fClipProxy.fTop <= 0) { | 221 if (fClipProxy.fTop <= 0) { |
| 222 fClipProxy.fTop = SK_ScalarMin; | 222 fClipProxy.fTop = SK_ScalarMin; |
| 223 } | 223 } |
| 224 if (fClipProxy.fRight >= this->getDrawState().getRenderTarget()->wid
th()) { | 224 if (fClipProxy.fRight >= this->getDrawState().getRenderTarget()->wid
th()) { |
| 225 fClipProxy.fRight = SK_ScalarMax; | 225 fClipProxy.fRight = SK_ScalarMax; |
| 226 } | 226 } |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 fCmds.push_back(kCopySurface_Cmd); | 850 fCmds.push_back(kCopySurface_Cmd); |
| 851 return &fCopySurfaces.push_back(); | 851 return &fCopySurfaces.push_back(); |
| 852 } | 852 } |
| 853 | 853 |
| 854 | 854 |
| 855 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { | 855 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { |
| 856 INHERITED::clipWillBeSet(newClipData); | 856 INHERITED::clipWillBeSet(newClipData); |
| 857 fClipSet = true; | 857 fClipSet = true; |
| 858 fClipProxyState = kUnknown_ClipProxyState; | 858 fClipProxyState = kUnknown_ClipProxyState; |
| 859 } | 859 } |
| OLD | NEW |