| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 return true; | 964 return true; |
| 965 } | 965 } |
| 966 | 966 |
| 967 // Check that the read/write rects are contained within the src/dst bounds. | 967 // Check that the read/write rects are contained within the src/dst bounds. |
| 968 SkASSERT(!clippedSrcRect.isEmpty()); | 968 SkASSERT(!clippedSrcRect.isEmpty()); |
| 969 SkASSERT(SkIRect::MakeWH(src->width(), src->height()).contains(clippedSrcRec
t)); | 969 SkASSERT(SkIRect::MakeWH(src->width(), src->height()).contains(clippedSrcRec
t)); |
| 970 SkASSERT(clippedDstPoint.fX >= 0 && clippedDstPoint.fY >= 0); | 970 SkASSERT(clippedDstPoint.fX >= 0 && clippedDstPoint.fY >= 0); |
| 971 SkASSERT(clippedDstPoint.fX + clippedSrcRect.width() <= dst->width() && | 971 SkASSERT(clippedDstPoint.fX + clippedSrcRect.width() <= dst->width() && |
| 972 clippedDstPoint.fY + clippedSrcRect.height() <= dst->height()); | 972 clippedDstPoint.fY + clippedSrcRect.height() <= dst->height()); |
| 973 | 973 |
| 974 return !dst->surfacePriv().isSameAs(src) && dst->asRenderTarget() && src->as
Texture(); | 974 return (dst != src) && dst->asRenderTarget() && src->asTexture(); |
| 975 } | 975 } |
| 976 | 976 |
| 977 void GrDrawTarget::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* d
esc) { | 977 void GrDrawTarget::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* d
esc) { |
| 978 // Make the dst of the copy be a render target because the default copySurfa
ce draws to the dst. | 978 // Make the dst of the copy be a render target because the default copySurfa
ce draws to the dst. |
| 979 desc->fOrigin = kDefault_GrSurfaceOrigin; | 979 desc->fOrigin = kDefault_GrSurfaceOrigin; |
| 980 desc->fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag; | 980 desc->fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag; |
| 981 desc->fConfig = src->config(); | 981 desc->fConfig = src->config(); |
| 982 } | 982 } |
| 983 | 983 |
| 984 /////////////////////////////////////////////////////////////////////////////// | 984 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 GrDrawState::AutoRestoreStencil* ars, | 1153 GrDrawState::AutoRestoreStencil* ars, |
| 1154 GrDrawState* ds, | 1154 GrDrawState* ds, |
| 1155 GrClipMaskManager::ScissorState* scissorState) { | 1155 GrClipMaskManager::ScissorState* scissorState) { |
| 1156 return fClipMaskManager.setupClipping(ds, | 1156 return fClipMaskManager.setupClipping(ds, |
| 1157 are, | 1157 are, |
| 1158 ars, | 1158 ars, |
| 1159 scissorState, | 1159 scissorState, |
| 1160 this->getClip(), | 1160 this->getClip(), |
| 1161 devBounds); | 1161 devBounds); |
| 1162 } | 1162 } |
| OLD | NEW |