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

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

Issue 1011273003: Move SkMatrixImageFilter into core, and add a factory fn for it. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Changed all callers to use SkImageFilter::CreateMatrixFilter() instead of SKMIF::Create() Created 5 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 | « samplecode/SampleFilterFuzz.cpp ('k') | src/core/SkMatrixImageFilter.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"
11 #include "SkChecksum.h" 11 #include "SkChecksum.h"
12 #include "SkDevice.h" 12 #include "SkDevice.h"
13 #include "SkLazyPtr.h" 13 #include "SkLazyPtr.h"
14 #include "SkMatrixImageFilter.h"
14 #include "SkReadBuffer.h" 15 #include "SkReadBuffer.h"
15 #include "SkWriteBuffer.h" 16 #include "SkWriteBuffer.h"
16 #include "SkRect.h" 17 #include "SkRect.h"
17 #include "SkTDynamicHash.h" 18 #include "SkTDynamicHash.h"
18 #include "SkTInternalLList.h" 19 #include "SkTInternalLList.h"
19 #include "SkValidationUtils.h" 20 #include "SkValidationUtils.h"
20 #if SK_SUPPORT_GPU 21 #if SK_SUPPORT_GPU
21 #include "GrContext.h" 22 #include "GrContext.h"
22 #include "SkGrPixelRef.h" 23 #include "SkGrPixelRef.h"
23 #include "SkGr.h" 24 #include "SkGr.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 // loop, but then return false on the next filter. 362 // loop, but then return false on the next filter.
362 *dst = bounds; 363 *dst = bounds;
363 return true; 364 return true;
364 } 365 }
365 366
366 bool SkImageFilter::asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&, 367 bool SkImageFilter::asFragmentProcessor(GrFragmentProcessor**, GrTexture*, const SkMatrix&,
367 const SkIRect&) const { 368 const SkIRect&) const {
368 return false; 369 return false;
369 } 370 }
370 371
372 SkImageFilter* SkImageFilter::CreateMatrixFilter(const SkMatrix& matrix,
373 SkFilterQuality filterQuality,
374 SkImageFilter* input) {
375 return SkMatrixImageFilter::Create(matrix, filterQuality, input);
376 }
377
371 #if SK_SUPPORT_GPU 378 #if SK_SUPPORT_GPU
372 379
373 void SkImageFilter::WrapTexture(GrTexture* texture, int width, int height, SkBit map* result) { 380 void SkImageFilter::WrapTexture(GrTexture* texture, int width, int height, SkBit map* result) {
374 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); 381 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
375 result->setInfo(info); 382 result->setInfo(info);
376 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); 383 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref();
377 } 384 }
378 385
379 bool SkImageFilter::getInputResultGPU(SkImageFilter::Proxy* proxy, 386 bool SkImageFilter::getInputResultGPU(SkImageFilter::Proxy* proxy,
380 const SkBitmap& src, const Context& ctx, 387 const SkBitmap& src, const Context& ctx,
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 494
488 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) { 495 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) {
489 return SkNEW_ARGS(CacheImpl, (maxBytes)); 496 return SkNEW_ARGS(CacheImpl, (maxBytes));
490 } 497 }
491 498
492 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache); 499 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache);
493 500
494 SkImageFilter::Cache* SkImageFilter::Cache::Get() { 501 SkImageFilter::Cache* SkImageFilter::Cache::Get() {
495 return cache.get(); 502 return cache.get();
496 } 503 }
OLDNEW
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | src/core/SkMatrixImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698