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 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1521 | 1521 |
1522 // drawDevice is defined to be in device coords. | 1522 // drawDevice is defined to be in device coords. |
1523 CHECK_SHOULD_DRAW(draw, true); | 1523 CHECK_SHOULD_DRAW(draw, true); |
1524 | 1524 |
1525 GrRenderTarget* devRT = dev->accessRenderTarget(); | 1525 GrRenderTarget* devRT = dev->accessRenderTarget(); |
1526 GrTexture* devTex; | 1526 GrTexture* devTex; |
1527 if (NULL == (devTex = devRT->asTexture())) { | 1527 if (NULL == (devTex = devRT->asTexture())) { |
1528 return; | 1528 return; |
1529 } | 1529 } |
1530 | 1530 |
1531 const SkBitmap& bm = dev->accessBitmap(false); | 1531 const SkImageInfo ii = dev->imageInfo(); |
1532 int w = bm.width(); | 1532 int w = ii.width(); |
1533 int h = bm.height(); | 1533 int h = ii.height(); |
1534 | 1534 |
1535 SkImageFilter* filter = paint.getImageFilter(); | 1535 SkImageFilter* filter = paint.getImageFilter(); |
1536 // This bitmap will own the filtered result as a texture. | 1536 // This bitmap will own the filtered result as a texture. |
1537 SkBitmap filteredBitmap; | 1537 SkBitmap filteredBitmap; |
1538 | 1538 |
1539 if (filter) { | 1539 if (filter) { |
1540 SkIPoint offset = SkIPoint::Make(0, 0); | 1540 SkIPoint offset = SkIPoint::Make(0, 0); |
1541 SkMatrix matrix(*draw.fMatrix); | 1541 SkMatrix matrix(*draw.fMatrix); |
1542 matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y)); | 1542 matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y)); |
1543 SkIRect clipBounds = SkIRect::MakeWH(devTex->width(), devTex->height()); | 1543 SkIRect clipBounds = SkIRect::MakeWH(devTex->width(), devTex->height()); |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1881 #endif | 1881 #endif |
1882 } | 1882 } |
1883 | 1883 |
1884 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1884 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1885 // We always return a transient cache, so it is freed after each | 1885 // We always return a transient cache, so it is freed after each |
1886 // filter traversal. | 1886 // filter traversal. |
1887 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1887 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1888 } | 1888 } |
1889 | 1889 |
1890 #endif | 1890 #endif |
OLD | NEW |