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 "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 | 1726 |
1727 SkAutoLockPixels alp(src, !src.getTexture()); | 1727 SkAutoLockPixels alp(src, !src.getTexture()); |
1728 if (!src.getTexture() && !src.readyToDraw()) { | 1728 if (!src.getTexture() && !src.readyToDraw()) { |
1729 return false; | 1729 return false; |
1730 } | 1730 } |
1731 | 1731 |
1732 GrTexture* texture; | 1732 GrTexture* texture; |
1733 // We assume here that the filter will not attempt to tile the src. Otherwis
e, this cache lookup | 1733 // We assume here that the filter will not attempt to tile the src. Otherwis
e, this cache lookup |
1734 // must be pushed upstack. | 1734 // must be pushed upstack. |
1735 AutoBitmapTexture abt(fContext, src, NULL, &texture); | 1735 AutoBitmapTexture abt(fContext, src, NULL, &texture); |
| 1736 if (!texture) { |
| 1737 return false; |
| 1738 } |
1736 | 1739 |
1737 return this->filterTexture(fContext, texture, src.width(), src.height(), | 1740 return this->filterTexture(fContext, texture, src.width(), src.height(), |
1738 filter, ctx, result, offset); | 1741 filter, ctx, result, offset); |
1739 } | 1742 } |
1740 | 1743 |
1741 /////////////////////////////////////////////////////////////////////////////// | 1744 /////////////////////////////////////////////////////////////////////////////// |
1742 | 1745 |
1743 // must be in SkCanvas::VertexMode order | 1746 // must be in SkCanvas::VertexMode order |
1744 static const GrPrimitiveType gVertexMode2PrimitiveType[] = { | 1747 static const GrPrimitiveType gVertexMode2PrimitiveType[] = { |
1745 kTriangles_GrPrimitiveType, | 1748 kTriangles_GrPrimitiveType, |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2038 #endif | 2041 #endif |
2039 } | 2042 } |
2040 | 2043 |
2041 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 2044 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
2042 // We always return a transient cache, so it is freed after each | 2045 // We always return a transient cache, so it is freed after each |
2043 // filter traversal. | 2046 // filter traversal. |
2044 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 2047 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
2045 } | 2048 } |
2046 | 2049 |
2047 #endif | 2050 #endif |
OLD | NEW |