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

Side by Side Diff: src/core/SkBitmapProcShader.h

Issue 2175563003: Bundle SkShader::asFragmentProcessor arguments in a struct (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix indentation to be less arbitrary Created 4 years, 5 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/SkPerlinNoiseShader.h ('k') | src/core/SkBitmapProcShader.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 2006 The Android Open Source Project 2 * Copyright 2006 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 #ifndef SkBitmapProcShader_DEFINED 8 #ifndef SkBitmapProcShader_DEFINED
9 #define SkBitmapProcShader_DEFINED 9 #define SkBitmapProcShader_DEFINED
10 10
(...skipping 12 matching lines...) Expand all
23 23
24 // SkBitmapProcShader stores bitmap coordinates in a 16bit buffer, as it 24 // SkBitmapProcShader stores bitmap coordinates in a 16bit buffer, as it
25 // communicates between its matrix-proc and its sampler-proc. Until we can 25 // communicates between its matrix-proc and its sampler-proc. Until we can
26 // widen that, we have to reject bitmaps that are larger. 26 // widen that, we have to reject bitmaps that are larger.
27 static bool BitmapIsTooBig(const SkBitmap&); 27 static bool BitmapIsTooBig(const SkBitmap&);
28 28
29 SK_TO_STRING_OVERRIDE() 29 SK_TO_STRING_OVERRIDE()
30 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapProcShader) 30 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapProcShader)
31 31
32 #if SK_SUPPORT_GPU 32 #if SK_SUPPORT_GPU
33 sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext*, const SkMatrix& v iewM, 33 sk_sp<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const overri de;
34 const SkMatrix*, SkFilterQual ity,
35 SkSourceGammaTreatment) const override;
36 #endif 34 #endif
37 35
38 protected: 36 protected:
39 void flatten(SkWriteBuffer&) const override; 37 void flatten(SkWriteBuffer&) const override;
40 size_t onContextSize(const ContextRec& rec) const override { 38 size_t onContextSize(const ContextRec& rec) const override {
41 return ContextSize(rec, fRawBitmap.info()); 39 return ContextSize(rec, fRawBitmap.info());
42 } 40 }
43 Context* onCreateContext(const ContextRec&, void* storage) const override; 41 Context* onCreateContext(const ContextRec&, void* storage) const override;
44 bool onIsABitmap(SkBitmap*, SkMatrix*, TileMode*) const override; 42 bool onIsABitmap(SkBitmap*, SkMatrix*, TileMode*) const override;
45 43
(...skipping 18 matching lines...) Expand all
64 // Note that some contexts may contain other contexts (e.g. for compose shaders) , but we've not 62 // Note that some contexts may contain other contexts (e.g. for compose shaders) , but we've not
65 // yet found a situation where the size below isn't big enough. 63 // yet found a situation where the size below isn't big enough.
66 typedef SkSmallAllocator<3, kSkBlitterContextSize> SkTBlitterAllocator; 64 typedef SkSmallAllocator<3, kSkBlitterContextSize> SkTBlitterAllocator;
67 65
68 // If alloc is non-nullptr, it will be used to allocate the returned SkShader, a nd MUST outlive 66 // If alloc is non-nullptr, it will be used to allocate the returned SkShader, a nd MUST outlive
69 // the SkShader. 67 // the SkShader.
70 sk_sp<SkShader> SkMakeBitmapShader(const SkBitmap& src, SkShader::TileMode, SkSh ader::TileMode, 68 sk_sp<SkShader> SkMakeBitmapShader(const SkBitmap& src, SkShader::TileMode, SkSh ader::TileMode,
71 const SkMatrix* localMatrix, SkTBlitterAlloca tor* alloc); 69 const SkMatrix* localMatrix, SkTBlitterAlloca tor* alloc);
72 70
73 #endif 71 #endif
OLDNEW
« no previous file with comments | « include/effects/SkPerlinNoiseShader.h ('k') | src/core/SkBitmapProcShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698