| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |