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

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

Issue 2312123003: Revert of Restructure flushing relationship between GrContext, GrDrawingManager, and GrResourceCache (Closed)
Patch Set: Created 4 years, 3 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 | « src/gpu/GrResourceCache.cpp ('k') | tests/ResourceCacheTest.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 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 bitmap.height() <= fContext->caps()->maxTextureSize()); 1001 bitmap.height() <= fContext->caps()->maxTextureSize());
1002 // We should be respecting the max tile size by the time we get here. 1002 // We should be respecting the max tile size by the time we get here.
1003 SkASSERT(bitmap.width() <= fContext->caps()->maxTileSize() && 1003 SkASSERT(bitmap.width() <= fContext->caps()->maxTileSize() &&
1004 bitmap.height() <= fContext->caps()->maxTileSize()); 1004 bitmap.height() <= fContext->caps()->maxTileSize());
1005 1005
1006 sk_sp<GrTexture> texture = GrMakeCachedBitmapTexture(fContext, bitmap, param s, 1006 sk_sp<GrTexture> texture = GrMakeCachedBitmapTexture(fContext, bitmap, param s,
1007 fDrawContext->sourceGam maTreatment()); 1007 fDrawContext->sourceGam maTreatment());
1008 if (nullptr == texture) { 1008 if (nullptr == texture) {
1009 return; 1009 return;
1010 } 1010 }
1011
1011 sk_sp<GrColorSpaceXform> colorSpaceXform = 1012 sk_sp<GrColorSpaceXform> colorSpaceXform =
1012 GrColorSpaceXform::Make(bitmap.colorSpace(), fDrawContext->getColorSpace ()); 1013 GrColorSpaceXform::Make(bitmap.colorSpace(), fDrawContext->getColorSpace ());
1013 1014
1014 SkScalar iw = 1.f / texture->width(); 1015 SkScalar iw = 1.f / texture->width();
1015 SkScalar ih = 1.f / texture->height(); 1016 SkScalar ih = 1.f / texture->height();
1016 1017
1017 SkMatrix texMatrix; 1018 SkMatrix texMatrix;
1018 // Compute a matrix that maps the rect we will draw to the src rect. 1019 // Compute a matrix that maps the rect we will draw to the src rect.
1019 texMatrix.setRectToRect(dstRect, srcRect, SkMatrix::kStart_ScaleToFit); 1020 texMatrix.setRectToRect(dstRect, srcRect, SkMatrix::kStart_ScaleToFit);
1020 texMatrix.postScale(iw, ih); 1021 texMatrix.postScale(iw, ih);
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1793 } 1794 }
1794 1795
1795 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { 1796 SkImageFilterCache* SkGpuDevice::getImageFilterCache() {
1796 ASSERT_SINGLE_OWNER 1797 ASSERT_SINGLE_OWNER
1797 // We always return a transient cache, so it is freed after each 1798 // We always return a transient cache, so it is freed after each
1798 // filter traversal. 1799 // filter traversal.
1799 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); 1800 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize);
1800 } 1801 }
1801 1802
1802 #endif 1803 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrResourceCache.cpp ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698