Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 792923002: Apply the layer's image filter to the hoisted image (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix cast Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/image/SkSurface_Gpu.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/image/SkSurface_Gpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698