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

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

Issue 1172693002: remove subclassing from ImageFilter::Proxy (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/SkDeviceImageFilterProxy.h ('k') | src/effects/SkPictureImageFilter.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 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 "SkImageFilter.h" 8 #include "SkImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 516
517 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache); 517 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache);
518 518
519 SkImageFilter::Cache* SkImageFilter::Cache::Get() { 519 SkImageFilter::Cache* SkImageFilter::Cache::Get() {
520 return cache.get(); 520 return cache.get();
521 } 521 }
522 522
523 void SkImageFilter::PurgeCache() { 523 void SkImageFilter::PurgeCache() {
524 cache.get()->purge(); 524 cache.get()->purge();
525 } 525 }
526
527 //////////////////////////////////////////////////////////////////////////////// ///////////////////
528
529 #include "SkBitmapDevice.h"
Stephen White 2015/06/09 15:17:04 Nit: move this to top-of-file?
530
531 SkBaseDevice* SkImageFilter::Proxy::createDevice(int w, int h) {
532 SkBaseDevice::CreateInfo cinfo(SkImageInfo::MakeN32Premul(w, h),
robertphillips 2015/06/09 17:07:29 What about the SkTileImageFilter?
Stephen White 2015/06/10 14:42:45 SkTileImageFilter always does an extractSubset() o
533 SkBaseDevice::kNever_TileUsage,
534 kUnknown_SkPixelGeometry,
535 true /*forImageFilter*/);
536 SkBaseDevice* dev = fDevice->onCreateDevice(cinfo, NULL);
robertphillips 2015/06/09 17:07:29 !dev ?
537 if (NULL == dev) {
538 dev = SkBitmapDevice::Create(cinfo.fInfo);
539 }
540 return dev;
541 }
542
543 bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitm ap& src,
544 const SkImageFilter::Context& ctx,
545 SkBitmap* result, SkIPoint* offset) {
546 return fDevice->filterImage(filter, src, ctx, result, offset);
547 }
548
OLDNEW
« no previous file with comments | « src/core/SkDeviceImageFilterProxy.h ('k') | src/effects/SkPictureImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698