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

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

Issue 1759653004: enforce 16byte alignment in shader contexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « src/core/SkBlitter.cpp ('k') | src/core/SkColorFilterShader.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 7
8 #ifndef SkColorFilterShader_DEFINED 8 #ifndef SkColorFilterShader_DEFINED
9 #define SkColorFilterShader_DEFINED 9 #define SkColorFilterShader_DEFINED
10 10
11 #include "SkColorFilter.h" 11 #include "SkColorFilter.h"
12 #include "SkShader.h" 12 #include "SkShader.h"
13 13
14 class SkColorFilterShader : public SkShader { 14 class SkColorFilterShader : public SkShader {
15 public: 15 public:
16 SkColorFilterShader(SkShader* shader, SkColorFilter* filter); 16 SkColorFilterShader(SkShader* shader, SkColorFilter* filter);
17 17
18 size_t contextSize(const ContextRec&) const override;
19
20 #if SK_SUPPORT_GPU 18 #if SK_SUPPORT_GPU
21 const GrFragmentProcessor* asFragmentProcessor(GrContext*, 19 const GrFragmentProcessor* asFragmentProcessor(GrContext*,
22 const SkMatrix& viewM, 20 const SkMatrix& viewM,
23 const SkMatrix* localMatrix, 21 const SkMatrix* localMatrix,
24 SkFilterQuality) const overri de; 22 SkFilterQuality) const overri de;
25 #endif 23 #endif
26 24
27 class FilterShaderContext : public SkShader::Context { 25 class FilterShaderContext : public SkShader::Context {
28 public: 26 public:
29 // Takes ownership of shaderContext and calls its destructor. 27 // Takes ownership of shaderContext and calls its destructor.
(...skipping 14 matching lines...) Expand all
44 SkShader::Context* fShaderContext; 42 SkShader::Context* fShaderContext;
45 43
46 typedef SkShader::Context INHERITED; 44 typedef SkShader::Context INHERITED;
47 }; 45 };
48 46
49 SK_TO_STRING_OVERRIDE() 47 SK_TO_STRING_OVERRIDE()
50 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorFilterShader) 48 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorFilterShader)
51 49
52 protected: 50 protected:
53 void flatten(SkWriteBuffer&) const override; 51 void flatten(SkWriteBuffer&) const override;
52 size_t onContextSize(const ContextRec&) const override;
54 Context* onCreateContext(const ContextRec&, void* storage) const override; 53 Context* onCreateContext(const ContextRec&, void* storage) const override;
55 54
56
57 private: 55 private:
58 SkAutoTUnref<SkShader> fShader; 56 SkAutoTUnref<SkShader> fShader;
59 SkAutoTUnref<SkColorFilter> fFilter; 57 SkAutoTUnref<SkColorFilter> fFilter;
60 58
61 typedef SkShader INHERITED; 59 typedef SkShader INHERITED;
62 }; 60 };
63 61
64 #endif 62 #endif
OLDNEW
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkColorFilterShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698