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

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

Issue 2357273002: Add output format properties to SkImageFilter::Context (Closed)
Patch Set: Spelling 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/SkGpuDevice.cpp ('k') | src/pdf/SkPDFDevice.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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 return nullptr; 339 return nullptr;
340 } 340 }
341 sk_sp<SkSpecialImage> srcSpecialImage = SkSpecialImage::MakeFromImage( 341 sk_sp<SkSpecialImage> srcSpecialImage = SkSpecialImage::MakeFromImage(
342 subset, sk_ref_sp(const_cast<SkImage*>(this))); 342 subset, sk_ref_sp(const_cast<SkImage*>(this)));
343 if (!srcSpecialImage) { 343 if (!srcSpecialImage) {
344 return nullptr; 344 return nullptr;
345 } 345 }
346 346
347 SkAutoTUnref<SkImageFilterCache> cache( 347 SkAutoTUnref<SkImageFilterCache> cache(
348 SkImageFilterCache::Create(SkImageFilterCache::kDefaultTransientSize)); 348 SkImageFilterCache::Create(SkImageFilterCache::kDefaultTransientSize));
349 SkImageFilter::Context context(SkMatrix::I(), clipBounds, cache.get()); 349 SkImageFilter::OutputProperties outputProperties(as_IB(this)->onImageInfo(). colorSpace());
350 SkImageFilter::Context context(SkMatrix::I(), clipBounds, cache.get(), outpu tProperties);
351
350 sk_sp<SkSpecialImage> result = 352 sk_sp<SkSpecialImage> result =
351 filter->filterImage(srcSpecialImage.get(), context, offset); 353 filter->filterImage(srcSpecialImage.get(), context, offset);
352 354
353 if (!result) { 355 if (!result) {
354 return nullptr; 356 return nullptr;
355 } 357 }
356 358
357 SkIRect fullSize = SkIRect::MakeWH(result->width(), result->height()); 359 SkIRect fullSize = SkIRect::MakeWH(result->width(), result->height());
358 #if SK_SUPPORT_GPU 360 #if SK_SUPPORT_GPU
359 if (result->isTextureBacked()) { 361 if (result->isTextureBacked()) {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 SkASSERT(image); 515 SkASSERT(image);
514 SkASSERT(ctx); 516 SkASSERT(ctx);
515 as_IB(image)->onPinAsTexture(ctx); 517 as_IB(image)->onPinAsTexture(ctx);
516 } 518 }
517 519
518 void SkImage_unpinAsTexture(const SkImage* image, GrContext* ctx) { 520 void SkImage_unpinAsTexture(const SkImage* image, GrContext* ctx) {
519 SkASSERT(image); 521 SkASSERT(image);
520 SkASSERT(ctx); 522 SkASSERT(ctx);
521 as_IB(image)->onUnpinAsTexture(ctx); 523 as_IB(image)->onUnpinAsTexture(ctx);
522 } 524 }
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698