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 "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
9 | 9 |
10 #include "effects/GrBicubicEffect.h" | 10 #include "effects/GrBicubicEffect.h" |
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 | 1195 |
1196 // The source rect has changed so update the matrix | 1196 // The source rect has changed so update the matrix |
1197 localM.preTranslate(offset.fX, offset.fY); | 1197 localM.preTranslate(offset.fX, offset.fY); |
1198 } | 1198 } |
1199 } else { | 1199 } else { |
1200 localM.reset(); | 1200 localM.reset(); |
1201 } | 1201 } |
1202 | 1202 |
1203 SkPaint paintWithShader(paint); | 1203 SkPaint paintWithShader(paint); |
1204 paintWithShader.setShader(SkShader::CreateBitmapShader(*bitmapPtr, | 1204 paintWithShader.setShader(SkShader::CreateBitmapShader(*bitmapPtr, |
1205 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode))->unref(); | 1205 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode, &localM))->unr
ef(); |
1206 paintWithShader.getShader()->setLocalMatrix(localM); | |
1207 SkRect dstRect = {0, 0, dstSize.fWidth, dstSize.fHeight}; | 1206 SkRect dstRect = {0, 0, dstSize.fWidth, dstSize.fHeight}; |
1208 this->drawRect(draw, dstRect, paintWithShader); | 1207 this->drawRect(draw, dstRect, paintWithShader); |
1209 | 1208 |
1210 return; | 1209 return; |
1211 } | 1210 } |
1212 | 1211 |
1213 // If there is no mask filter than it is OK to handle the src rect -> dst re
ct scaling using | 1212 // If there is no mask filter than it is OK to handle the src rect -> dst re
ct scaling using |
1214 // the view matrix rather than a local matrix. | 1213 // the view matrix rather than a local matrix. |
1215 SkMatrix m; | 1214 SkMatrix m; |
1216 m.setScale(dstSize.fWidth / srcRect.width(), | 1215 m.setScale(dstSize.fWidth / srcRect.width(), |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1999 const GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrC
reate(picture, i); | 1998 const GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrC
reate(picture, i); |
2000 | 1999 |
2001 SkDebugf("%d (%d), ", i, layer->layerID()); | 2000 SkDebugf("%d (%d), ", i, layer->layerID()); |
2002 } | 2001 } |
2003 } | 2002 } |
2004 SkDebugf("\n"); | 2003 SkDebugf("\n"); |
2005 #endif | 2004 #endif |
2006 | 2005 |
2007 return false; | 2006 return false; |
2008 } | 2007 } |
OLD | NEW |