| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 return texture->asRenderTarget(); | 221 return texture->asRenderTarget(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 // This method ensures that we always have a texture-backed "bitmap" when we fin
ally | 224 // This method ensures that we always have a texture-backed "bitmap" when we fin
ally |
| 225 // call through to the base impl so that the image filtering code will take the | 225 // call through to the base impl so that the image filtering code will take the |
| 226 // gpu-specific paths. This mirrors SkCanvas::internalDrawDevice (the other | 226 // gpu-specific paths. This mirrors SkCanvas::internalDrawDevice (the other |
| 227 // use of SkImageFilter::filterImage) in that the source and dest will have | 227 // use of SkImageFilter::filterImage) in that the source and dest will have |
| 228 // homogenous backing (e.g., raster or gpu). | 228 // homogenous backing (e.g., raster or gpu). |
| 229 void SkGpuDevice::drawSpriteWithFilter(const SkDraw& draw, const SkBitmap& bitma
p, | 229 void SkGpuDevice::drawSpriteWithFilter(const SkDraw& draw, const SkBitmap& bitma
p, |
| 230 int x, int y, const SkPaint& paint) { | 230 int x, int y, const SkPaint& paint) { |
| 231 ASSERT_SINGLE_OWNER |
| 232 GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawSpriteWithFilter", fConte
xt); |
| 233 |
| 234 if (fContext->abandoned()) { |
| 235 return; |
| 236 } |
| 237 |
| 231 if (bitmap.getTexture()) { | 238 if (bitmap.getTexture()) { |
| 232 INHERITED::drawSpriteWithFilter(draw, bitmap, x, y, paint); | 239 INHERITED::drawSpriteWithFilter(draw, bitmap, x, y, paint); |
| 233 return; | 240 return; |
| 234 } | 241 } |
| 235 | 242 |
| 236 SkAutoLockPixels alp(bitmap, !bitmap.getTexture()); | 243 SkAutoLockPixels alp(bitmap, !bitmap.getTexture()); |
| 237 if (!bitmap.getTexture() && !bitmap.readyToDraw()) { | 244 if (!bitmap.getTexture() && !bitmap.readyToDraw()) { |
| 238 return; | 245 return; |
| 239 } | 246 } |
| 240 | 247 |
| (...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1915 } | 1922 } |
| 1916 | 1923 |
| 1917 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1924 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1918 ASSERT_SINGLE_OWNER | 1925 ASSERT_SINGLE_OWNER |
| 1919 // We always return a transient cache, so it is freed after each | 1926 // We always return a transient cache, so it is freed after each |
| 1920 // filter traversal. | 1927 // filter traversal. |
| 1921 return SkGpuDevice::NewImageFilterCache(); | 1928 return SkGpuDevice::NewImageFilterCache(); |
| 1922 } | 1929 } |
| 1923 | 1930 |
| 1924 #endif | 1931 #endif |
| OLD | NEW |