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

Side by Side Diff: src/image/SkImage.cpp

Issue 1421493003: tunnel down texture-size-constraint to imagefilters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix formating Created 5 years, 2 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/SkGpuDevice.cpp ('k') | src/image/SkImage_Gpu.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 2012 Google Inc. 2 * Copyright 2012 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBitmapCache.h" 9 #include "SkBitmapCache.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 SkBitmap src; 109 SkBitmap src;
110 if (!this->getROPixels(&src)) { 110 if (!this->getROPixels(&src)) {
111 return nullptr; 111 return nullptr;
112 } 112 }
113 113
114 const SkIRect srcBounds = SkIRect::MakeWH(this->width(), this->height()); 114 const SkIRect srcBounds = SkIRect::MakeWH(this->width(), this->height());
115 115
116 if (forceResultToOriginalSize) { 116 if (forceResultToOriginalSize) {
117 const SkIRect clipBounds = srcBounds; 117 const SkIRect clipBounds = srcBounds;
118 SkRasterImageFilterProxy proxy; 118 SkRasterImageFilterProxy proxy;
119 SkImageFilter::Context ctx(SkMatrix::I(), clipBounds, SkImageFilter::Cac he::Get()); 119 SkImageFilter::Context ctx(SkMatrix::I(), clipBounds, SkImageFilter::Cac he::Get(),
120 SkImageFilter::kExact_SizeConstraint);
120 121
121 SkBitmap dst; 122 SkBitmap dst;
122 if (filter->filterImage(&proxy, src, ctx, &dst, offsetResult)) { 123 if (filter->filterImage(&proxy, src, ctx, &dst, offsetResult)) {
123 dst.setImmutable(); 124 dst.setImmutable();
124 return SkImage::NewFromBitmap(dst); 125 return SkImage::NewFromBitmap(dst);
125 } 126 }
126 } else { 127 } else {
127 const SkIRect dstR = compute_fast_ibounds(filter, srcBounds); 128 const SkIRect dstR = compute_fast_ibounds(filter, srcBounds);
128 129
129 SkImageInfo info = SkImageInfo::MakeN32Premul(dstR.width(), dstR.height( )); 130 SkImageInfo info = SkImageInfo::MakeN32Premul(dstR.width(), dstR.height( ));
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 396
396 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType) { 397 SkImage* SkImage::NewFromAdoptedTexture(GrContext*, const GrBackendTextureDesc&, SkAlphaType) {
397 return nullptr; 398 return nullptr;
398 } 399 }
399 400
400 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk AlphaType) { 401 SkImage* SkImage::NewFromTextureCopy(GrContext*, const GrBackendTextureDesc&, Sk AlphaType) {
401 return nullptr; 402 return nullptr;
402 } 403 }
403 404
404 #endif 405 #endif
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698