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

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

Issue 366133002: move SkChecksum and SkEmptyShader to private (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/core/SkChecksum.h ('k') | src/core/SkChecksum.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkEmptyShader_DEFINED
9 #define SkEmptyShader_DEFINED
10
11 #include "SkShader.h"
12
13 // TODO: move this to private, as there is a public factory on SkShader
14
15 /**
16 * \class SkEmptyShader
17 * A Shader that always draws nothing. Its createContext always returns NULL.
18 */
19 class SK_API SkEmptyShader : public SkShader {
20 public:
21 SkEmptyShader() {}
22
23 virtual size_t contextSize() const SK_OVERRIDE {
24 // Even though createContext returns NULL we have to return a value of a t least
25 // sizeof(SkShader::Context) to satisfy SkSmallAllocator.
26 return sizeof(SkShader::Context);
27 }
28
29 SK_TO_STRING_OVERRIDE()
30 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmptyShader)
31
32 protected:
33 SkEmptyShader(SkReadBuffer& buffer) : INHERITED(buffer) {}
34
35 virtual SkShader::Context* onCreateContext(const ContextRec&, void*) const S K_OVERRIDE {
36 return NULL;
37 }
38
39 private:
40 typedef SkShader INHERITED;
41 };
42
43 #endif
OLDNEW
« no previous file with comments | « include/core/SkChecksum.h ('k') | src/core/SkChecksum.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698