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 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 AutoBitmapTexture abt(fContext, src, NULL, &texture); | 1467 AutoBitmapTexture abt(fContext, src, NULL, &texture); |
1468 if (!texture) { | 1468 if (!texture) { |
1469 return false; | 1469 return false; |
1470 } | 1470 } |
1471 | 1471 |
1472 return this->filterTexture(fContext, texture, src.width(), src.height(), | 1472 return this->filterTexture(fContext, texture, src.width(), src.height(), |
1473 filter, ctx, result, offset); | 1473 filter, ctx, result, offset); |
1474 } | 1474 } |
1475 | 1475 |
1476 static bool wrap_as_bm(const SkImage* image, SkBitmap* bm) { | 1476 static bool wrap_as_bm(const SkImage* image, SkBitmap* bm) { |
1477 GrTexture* tex = image->getTexture(); | 1477 GrTexture* tex = as_IB(image)->getTexture(); |
1478 if (tex) { | 1478 if (tex) { |
1479 GrWrapTextureInBitmap(tex, image->width(), image->height(), image->isOpa
que(), bm); | 1479 GrWrapTextureInBitmap(tex, image->width(), image->height(), image->isOpa
que(), bm); |
1480 return true; | 1480 return true; |
1481 } else { | 1481 } else { |
1482 return as_IB(image)->getROPixels(bm); | 1482 return as_IB(image)->getROPixels(bm); |
1483 } | 1483 } |
1484 } | 1484 } |
1485 | 1485 |
1486 void SkGpuDevice::drawImage(const SkDraw& draw, const SkImage* image, SkScalar x
, SkScalar y, | 1486 void SkGpuDevice::drawImage(const SkDraw& draw, const SkImage* image, SkScalar x
, SkScalar y, |
1487 const SkPaint& paint) { | 1487 const SkPaint& paint) { |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1789 #endif | 1789 #endif |
1790 } | 1790 } |
1791 | 1791 |
1792 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1792 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1793 // We always return a transient cache, so it is freed after each | 1793 // We always return a transient cache, so it is freed after each |
1794 // filter traversal. | 1794 // filter traversal. |
1795 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1795 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1796 } | 1796 } |
1797 | 1797 |
1798 #endif | 1798 #endif |
OLD | NEW |