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

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

Issue 1768433003: remove align16 calls in skhader context sizes. will handle this elsewhere as needed (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/SkDraw.cpp ('k') | src/core/SkLightingShader.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 2011 Google Inc. 2 * Copyright 2011 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 SkEmptyShader_DEFINED 8 #ifndef SkEmptyShader_DEFINED
9 #define SkEmptyShader_DEFINED 9 #define SkEmptyShader_DEFINED
10 10
11 #include "SkShader.h" 11 #include "SkShader.h"
12 12
13 // TODO: move this to private, as there is a public factory on SkShader 13 // TODO: move this to private, as there is a public factory on SkShader
14 14
15 /** 15 /**
16 * \class SkEmptyShader 16 * \class SkEmptyShader
17 * A Shader that always draws nothing. Its createContext always returns nullptr . 17 * A Shader that always draws nothing. Its createContext always returns nullptr .
18 */ 18 */
19 class SK_API SkEmptyShader : public SkShader { 19 class SK_API SkEmptyShader : public SkShader {
20 public: 20 public:
21 SkEmptyShader() {} 21 SkEmptyShader() {}
22 22
23 SK_TO_STRING_OVERRIDE() 23 SK_TO_STRING_OVERRIDE()
24 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmptyShader) 24 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmptyShader)
25 25
26 protected: 26 protected:
27 size_t onContextSize(const ContextRec&) const override { 27 size_t onContextSize(const ContextRec&) const override {
28 // Even though createContext returns nullptr we have to return a value o f at least 28 // Even though createContext returns nullptr we have to return a value o f at least
29 // sizeof(SkShader::Context) to satisfy SkSmallAllocator. 29 // sizeof(SkShader::Context) to satisfy SkSmallAllocator.
30 return SkAlign16(sizeof(SkShader::Context)); 30 return sizeof(SkShader::Context);
31 } 31 }
32 32
33 SkShader::Context* onCreateContext(const ContextRec&, void*) const override { 33 SkShader::Context* onCreateContext(const ContextRec&, void*) const override {
34 return nullptr; 34 return nullptr;
35 } 35 }
36 36
37 void flatten(SkWriteBuffer& buffer) const override { 37 void flatten(SkWriteBuffer& buffer) const override {
38 // Do nothing. 38 // Do nothing.
39 // We just don't want to fall through to SkShader::flatten(), 39 // We just don't want to fall through to SkShader::flatten(),
40 // which will write data we don't care to serialize or decode. 40 // which will write data we don't care to serialize or decode.
41 } 41 }
42 42
43 private: 43 private:
44 typedef SkShader INHERITED; 44 typedef SkShader INHERITED;
45 }; 45 };
46 46
47 #endif 47 #endif
OLDNEW
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkLightingShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698