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

Side by Side Diff: src/core/SkSpecialImage.cpp

Issue 1782083002: Switch SkColorFilterImageFilter over to new onFilterImage interface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Handle empty SkBitmaps in makeTextureImage Created 4 years, 9 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/effects/SkColorFilterImageFilter.h ('k') | src/effects/SkColorFilterImageFilter.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 2016 Google Inc. 2 * Copyright 2016 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 #include "SkSpecialImage.h" 7 #include "SkSpecialImage.h"
8 8
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 #include "GrTexture.h" 10 #include "GrTexture.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 if (GrTexture* peek = as_SIB(this)->peekTexture()) { 61 if (GrTexture* peek = as_SIB(this)->peekTexture()) {
62 return peek->getContext() == context ? sk_sp<SkSpecialImage>(SkRef(this) ) : nullptr; 62 return peek->getContext() == context ? sk_sp<SkSpecialImage>(SkRef(this) ) : nullptr;
63 } 63 }
64 64
65 SkBitmap bmp; 65 SkBitmap bmp;
66 if (!this->internal_getBM(&bmp)) { 66 if (!this->internal_getBM(&bmp)) {
67 return nullptr; 67 return nullptr;
68 } 68 }
69 69
70 if (bmp.empty()) {
71 return SkSpecialImage::MakeFromRaster(proxy, SkIRect::MakeEmpty(), bmp);
72 }
73
70 SkAutoTUnref<GrTexture> resultTex( 74 SkAutoTUnref<GrTexture> resultTex(
71 GrRefCachedBitmapTexture(context, bmp, GrTextureParams::ClampNoFilter()) ); 75 GrRefCachedBitmapTexture(context, bmp, GrTextureParams::ClampNoFilter()) );
72 if (!resultTex) { 76 if (!resultTex) {
73 return nullptr; 77 return nullptr;
74 } 78 }
75 79
76 SkAlphaType at = this->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaTyp e; 80 SkAlphaType at = this->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaTyp e;
77 81
78 return SkSpecialImage::MakeFromGpu(proxy, 82 return SkSpecialImage::MakeFromGpu(proxy,
79 SkIRect::MakeWH(resultTex->width(), resul tTex->height()), 83 SkIRect::MakeWH(resultTex->width(), resul tTex->height()),
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 539
536 sk_sp<SkSpecialImage> SkSpecialImage::MakeFromGpu(SkImageFilter::Proxy* proxy, 540 sk_sp<SkSpecialImage> SkSpecialImage::MakeFromGpu(SkImageFilter::Proxy* proxy,
537 const SkIRect& subset, 541 const SkIRect& subset,
538 uint32_t uniqueID, 542 uint32_t uniqueID,
539 GrTexture* tex, 543 GrTexture* tex,
540 SkAlphaType at) { 544 SkAlphaType at) {
541 return nullptr; 545 return nullptr;
542 } 546 }
543 547
544 #endif 548 #endif
OLDNEW
« no previous file with comments | « include/effects/SkColorFilterImageFilter.h ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698