| 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 if (!SkDraw::DrawToMask(devPath, &clip.getBounds(), filter, &context->getMat
rix(), &srcM, | 599 if (!SkDraw::DrawToMask(devPath, &clip.getBounds(), filter, &context->getMat
rix(), &srcM, |
| 600 SkMask::kComputeBoundsAndRenderImage_CreateMode, sty
le)) { | 600 SkMask::kComputeBoundsAndRenderImage_CreateMode, sty
le)) { |
| 601 return false; | 601 return false; |
| 602 } | 602 } |
| 603 SkAutoMaskFreeImage autoSrc(srcM.fImage); | 603 SkAutoMaskFreeImage autoSrc(srcM.fImage); |
| 604 | 604 |
| 605 if (!filter->filterMask(&dstM, srcM, context->getMatrix(), NULL)) { | 605 if (!filter->filterMask(&dstM, srcM, context->getMatrix(), NULL)) { |
| 606 return false; | 606 return false; |
| 607 } | 607 } |
| 608 // this will free-up dstM when we're done (allocated in filterMask()) | 608 // this will free-up dstM when we're done (allocated in filterMask()) |
| 609 SkAutoMaskFreeImage autoDst(dstM.fImage); | |
| 610 | 609 |
| 611 if (clip.quickReject(dstM.fBounds)) { | 610 if (clip.quickReject(dstM.fBounds)) { |
| 612 return false; | 611 return false; |
| 613 } | 612 } |
| 614 | 613 |
| 615 // we now have a device-aligned 8bit mask in dstM, ready to be drawn using | 614 // we now have a device-aligned 8bit mask in dstM, ready to be drawn using |
| 616 // the current clip (and identity matrix) and GrPaint settings | 615 // the current clip (and identity matrix) and GrPaint settings |
| 617 GrTextureDesc desc; | 616 GrTextureDesc desc; |
| 618 desc.fWidth = dstM.fBounds.width(); | 617 desc.fWidth = dstM.fBounds.width(); |
| 619 desc.fHeight = dstM.fBounds.height(); | 618 desc.fHeight = dstM.fBounds.height(); |
| (...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1943 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), picture); | 1942 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), picture); |
| 1944 | 1943 |
| 1945 return true; | 1944 return true; |
| 1946 } | 1945 } |
| 1947 | 1946 |
| 1948 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1947 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1949 // We always return a transient cache, so it is freed after each | 1948 // We always return a transient cache, so it is freed after each |
| 1950 // filter traversal. | 1949 // filter traversal. |
| 1951 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1950 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 1952 } | 1951 } |
| OLD | NEW |