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

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

Issue 1351533004: share code between SkGr and Cacherator (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/core/SkImageCacherator.cpp ('k') | src/gpu/SkGr.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 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 SkScalar w = SkIntToScalar(bitmap.width()); 1058 SkScalar w = SkIntToScalar(bitmap.width());
1059 SkScalar h = SkIntToScalar(bitmap.height()); 1059 SkScalar h = SkIntToScalar(bitmap.height());
1060 dstSize.fWidth = w; 1060 dstSize.fWidth = w;
1061 dstSize.fHeight = h; 1061 dstSize.fHeight = h;
1062 srcRect.set(0, 0, w, h); 1062 srcRect.set(0, 0, w, h);
1063 } else { 1063 } else {
1064 SkASSERT(dstSizePtr); 1064 SkASSERT(dstSizePtr);
1065 srcRect = *srcRectPtr; 1065 srcRect = *srcRectPtr;
1066 dstSize = *dstSizePtr; 1066 dstSize = *dstSizePtr;
1067 } 1067 }
1068 GrTexture* tex = bitmap.getTexture(); 1068
robertphillips 2015/09/16 16:23:27 It seems like this should be: // Does 'srcRect' c
reed1 2015/09/16 17:03:31 Done.
1069 int width = tex ? tex->width() : bitmap.width(); 1069 int width, height;
1070 int height = tex ? tex->height() : bitmap.height(); 1070 {
1071 GrTexture* tex = bitmap.getTexture();
1072 width = tex ? tex->width() : bitmap.width();
1073 height = tex ? tex->height() : bitmap.height();
1074 }
1071 if (srcRect.fLeft <= 0 && srcRect.fTop <= 0 && 1075 if (srcRect.fLeft <= 0 && srcRect.fTop <= 0 &&
1072 srcRect.fRight >= width && srcRect.fBottom >= height) { 1076 srcRect.fRight >= width && srcRect.fBottom >= height) {
1073 constraint = SkCanvas::kFast_SrcRectConstraint; 1077 constraint = SkCanvas::kFast_SrcRectConstraint;
1074 } 1078 }
1075 1079
1076 // If the render target is not msaa and draw is antialiased, we call 1080 // If the render target is not msaa and draw is antialiased, we call
1077 // drawRect instead of drawing on the render target directly. 1081 // drawRect instead of drawing on the render target directly.
1078 // FIXME: the tiled bitmap code path doesn't currently support 1082 // FIXME: the tiled bitmap code path doesn't currently support
1079 // anti-aliased edges, we work around that for now by drawing directly 1083 // anti-aliased edges, we work around that for now by drawing directly
1080 // if the image size exceeds maximum texture size. 1084 // if the image size exceeds maximum texture size.
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 #endif 1978 #endif
1975 } 1979 }
1976 1980
1977 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 1981 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
1978 // We always return a transient cache, so it is freed after each 1982 // We always return a transient cache, so it is freed after each
1979 // filter traversal. 1983 // filter traversal.
1980 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 1984 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
1981 } 1985 }
1982 1986
1983 #endif 1987 #endif
OLDNEW
« no previous file with comments | « src/core/SkImageCacherator.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698