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 "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1058 SkScalar w = SkIntToScalar(bitmap.width()); | 1058 SkScalar w = SkIntToScalar(bitmap.width()); |
1059 SkScalar h = SkIntToScalar(bitmap.height()); | 1059 SkScalar h = SkIntToScalar(bitmap.height()); |
1060 dstSize.fWidth = w; | 1060 dstSize.fWidth = w; |
1061 dstSize.fHeight = h; | 1061 dstSize.fHeight = h; |
1062 srcRect.set(0, 0, w, h); | 1062 srcRect.set(0, 0, w, h); |
1063 } else { | 1063 } else { |
1064 SkASSERT(dstSizePtr); | 1064 SkASSERT(dstSizePtr); |
1065 srcRect = *srcRectPtr; | 1065 srcRect = *srcRectPtr; |
1066 dstSize = *dstSizePtr; | 1066 dstSize = *dstSizePtr; |
1067 } | 1067 } |
1068 GrTexture* tex = bitmap.getTexture(); | 1068 |
robertphillips
2015/09/16 16:23:27
It seems like this should be:
// Does 'srcRect' c
reed1
2015/09/16 17:03:31
Done.
| |
1069 int width = tex ? tex->width() : bitmap.width(); | 1069 int width, height; |
1070 int height = tex ? tex->height() : bitmap.height(); | 1070 { |
1071 GrTexture* tex = bitmap.getTexture(); | |
1072 width = tex ? tex->width() : bitmap.width(); | |
1073 height = tex ? tex->height() : bitmap.height(); | |
1074 } | |
1071 if (srcRect.fLeft <= 0 && srcRect.fTop <= 0 && | 1075 if (srcRect.fLeft <= 0 && srcRect.fTop <= 0 && |
1072 srcRect.fRight >= width && srcRect.fBottom >= height) { | 1076 srcRect.fRight >= width && srcRect.fBottom >= height) { |
1073 constraint = SkCanvas::kFast_SrcRectConstraint; | 1077 constraint = SkCanvas::kFast_SrcRectConstraint; |
1074 } | 1078 } |
1075 | 1079 |
1076 // If the render target is not msaa and draw is antialiased, we call | 1080 // If the render target is not msaa and draw is antialiased, we call |
1077 // drawRect instead of drawing on the render target directly. | 1081 // drawRect instead of drawing on the render target directly. |
1078 // FIXME: the tiled bitmap code path doesn't currently support | 1082 // FIXME: the tiled bitmap code path doesn't currently support |
1079 // anti-aliased edges, we work around that for now by drawing directly | 1083 // anti-aliased edges, we work around that for now by drawing directly |
1080 // if the image size exceeds maximum texture size. | 1084 // if the image size exceeds maximum texture size. |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1974 #endif | 1978 #endif |
1975 } | 1979 } |
1976 | 1980 |
1977 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1981 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1978 // We always return a transient cache, so it is freed after each | 1982 // We always return a transient cache, so it is freed after each |
1979 // filter traversal. | 1983 // filter traversal. |
1980 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1984 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1981 } | 1985 } |
1982 | 1986 |
1983 #endif | 1987 #endif |
OLD | NEW |