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

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

Issue 2080993002: Added API for Bevel NormalSource. (Closed) Base URL: https://skia.googlesource.com/skia@dvonbeck-diffuse-api-change
Patch Set: Addressed patch 9 comments Created 4 years, 4 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
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 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 SkNormalBevelSource_DEFINED
9 #define SkNormalBevelSource_DEFINED
10
11 #include "SkNormalSource.h"
12
13 class SK_API SkNormalBevelSourceImpl : public SkNormalSource {
14 public:
15 SkNormalBevelSourceImpl(BevelType type, SkScalar width, SkScalar height)
16 : fType(type)
17 , fWidth(width)
18 , fHeight(height) {}
19
20 #if SK_SUPPORT_GPU
21 sk_sp<GrFragmentProcessor> asFragmentProcessor(GrContext*,
22 const SkMatrix& viewM,
23 const SkMatrix* localMatrix,
24 SkFilterQuality,
25 SkSourceGammaTreatment) const override;
26 #endif
27
28 SkNormalSource::Provider* asProvider(const SkShader::ContextRec& rec,
29 void* storage) const override;
30 size_t providerSize(const SkShader::ContextRec& rec) const override;
31
32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkNormalBevelSourceImpl)
33
34 protected:
35 void flatten(SkWriteBuffer& buf) const override;
36
37 private:
38 class Provider : public SkNormalSource::Provider {
39 public:
40 Provider(const SkNormalBevelSourceImpl& source);
41
42 virtual ~Provider();
43
44 void fillScanLine(int x, int y, SkPoint3 output[], int count) const over ride;
45
46 private:
47 const SkNormalBevelSourceImpl& fSource;
48
49 typedef SkNormalSource::Provider INHERITED;
50
51 };
52
53 SkNormalSource::BevelType fType;
54 SkScalar fWidth;
55 SkScalar fHeight;
56
57 friend class SkNormalSource;
58
59 typedef SkNormalSource INHERITED;
60 };
61
62
63 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698