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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 // nothing to draw | 932 // nothing to draw |
933 return; | 933 return; |
934 } | 934 } |
935 | 935 |
936 GrAutoScratchTexture mask; | 936 GrAutoScratchTexture mask; |
937 | 937 |
938 if (create_mask_GPU(fContext, maskRect, *devPathPtr, stroke, | 938 if (create_mask_GPU(fContext, maskRect, *devPathPtr, stroke, |
939 grPaint.isAntiAlias(), &mask)) { | 939 grPaint.isAntiAlias(), &mask)) { |
940 GrTexture* filtered; | 940 GrTexture* filtered; |
941 | 941 |
942 if (paint.getMaskFilter()->filterMaskGPU(mask.texture(), maskRec
t, &filtered, true)) { | 942 if (paint.getMaskFilter()->filterMaskGPU(mask.texture(), |
| 943 fContext->getMatrix(),
maskRect, |
| 944 &filtered, true)) { |
943 // filterMaskGPU gives us ownership of a ref to the result | 945 // filterMaskGPU gives us ownership of a ref to the result |
944 SkAutoTUnref<GrTexture> atu(filtered); | 946 SkAutoTUnref<GrTexture> atu(filtered); |
945 | 947 |
946 // If the scratch texture that we used as the filter src als
o holds the filter | 948 // If the scratch texture that we used as the filter src als
o holds the filter |
947 // result then we must detach so that this texture isn't rec
ycled for a later | 949 // result then we must detach so that this texture isn't rec
ycled for a later |
948 // draw. | 950 // draw. |
949 if (filtered == mask.texture()) { | 951 if (filtered == mask.texture()) { |
950 mask.detach(); | 952 mask.detach(); |
951 filtered->unref(); // detach transfers GrAutoScratchText
ure's ref to us. | 953 filtered->unref(); // detach transfers GrAutoScratchText
ure's ref to us. |
952 } | 954 } |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1919 GrTexture* texture, | 1921 GrTexture* texture, |
1920 bool needClear) | 1922 bool needClear) |
1921 : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) { | 1923 : SkBitmapDevice(make_bitmap(context, texture->asRenderTarget())) { |
1922 | 1924 |
1923 SkASSERT(texture && texture->asRenderTarget()); | 1925 SkASSERT(texture && texture->asRenderTarget()); |
1924 // This constructor is called from onCreateCompatibleDevice. It has locked t
he RT in the texture | 1926 // This constructor is called from onCreateCompatibleDevice. It has locked t
he RT in the texture |
1925 // cache. We pass true for the third argument so that it will get unlocked. | 1927 // cache. We pass true for the third argument so that it will get unlocked. |
1926 this->initFromRenderTarget(context, texture->asRenderTarget(), true); | 1928 this->initFromRenderTarget(context, texture->asRenderTarget(), true); |
1927 fNeedClear = needClear; | 1929 fNeedClear = needClear; |
1928 } | 1930 } |
OLD | NEW |