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

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

Issue 1166993002: Towards removing getTexture() from SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 6 months 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 | « include/core/SkImage.h ('k') | src/image/SkImage.cpp » ('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 "GrBlurUtils.h" 10 #include "GrBlurUtils.h"
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | src/image/SkImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698