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

Side by Side Diff: src/gpu/GrSoftwarePathRenderer.h

Issue 2335343008: Add optional sw generated path coverage mask caching (Closed)
Patch Set: Add .fs to literals in new gm Created 4 years, 2 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/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/GrSoftwarePathRenderer.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 2012 Google Inc. 2 * Copyright 2012 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 GrSoftwarePathRenderer_DEFINED 8 #ifndef GrSoftwarePathRenderer_DEFINED
9 #define GrSoftwarePathRenderer_DEFINED 9 #define GrSoftwarePathRenderer_DEFINED
10 10
11 #include "GrPathRenderer.h" 11 #include "GrPathRenderer.h"
12 12
13 class GrTextureProvider; 13 class GrTextureProvider;
14 14
15 /** 15 /**
16 * This class uses the software side to render a path to an SkBitmap and 16 * This class uses the software side to render a path to an SkBitmap and
17 * then uploads the result to the gpu 17 * then uploads the result to the gpu
18 */ 18 */
19 class GrSoftwarePathRenderer : public GrPathRenderer { 19 class GrSoftwarePathRenderer : public GrPathRenderer {
20 public: 20 public:
21 GrSoftwarePathRenderer(GrTextureProvider* texProvider) : fTexProvider(texPro vider) { } 21 GrSoftwarePathRenderer(GrTextureProvider* texProvider, bool allowCaching)
22 : fTexProvider(texProvider)
23 , fAllowCaching(allowCaching) {}
22 private: 24 private:
23 static void DrawNonAARect(GrDrawContext* drawContext, 25 static void DrawNonAARect(GrDrawContext* drawContext,
24 const GrPaint& paint, 26 const GrPaint& paint,
25 const GrUserStencilSettings& userStencilSettings, 27 const GrUserStencilSettings& userStencilSettings,
26 const GrClip& clip, 28 const GrClip& clip,
27 const SkMatrix& viewMatrix, 29 const SkMatrix& viewMatrix,
28 const SkRect& rect, 30 const SkRect& rect,
29 const SkMatrix& localMatrix); 31 const SkMatrix& localMatrix);
30 static void DrawAroundInvPath(GrDrawContext* drawContext, 32 static void DrawAroundInvPath(GrDrawContext* drawContext,
31 const GrPaint& paint, 33 const GrPaint& paint,
32 const GrUserStencilSettings& userStencilSettin gs, 34 const GrUserStencilSettings& userStencilSettin gs,
33 const GrClip& clip, 35 const GrClip& clip,
34 const SkMatrix& viewMatrix, 36 const SkMatrix& viewMatrix,
35 const SkIRect& devClipBounds, 37 const SkIRect& devClipBounds,
36 const SkIRect& devPathBounds); 38 const SkIRect& devPathBounds);
37 39
38 StencilSupport onGetStencilSupport(const GrShape&) const override { 40 StencilSupport onGetStencilSupport(const GrShape&) const override {
39 return GrPathRenderer::kNoSupport_StencilSupport; 41 return GrPathRenderer::kNoSupport_StencilSupport;
40 } 42 }
41 43
42 bool onCanDrawPath(const CanDrawPathArgs&) const override; 44 bool onCanDrawPath(const CanDrawPathArgs&) const override;
43 45
44 bool onDrawPath(const DrawPathArgs&) override; 46 bool onDrawPath(const DrawPathArgs&) override;
45 47
46 private: 48 private:
47 GrTextureProvider* fTexProvider; 49 GrTextureProvider* fTexProvider;
50 bool fAllowCaching;
48 51
49 typedef GrPathRenderer INHERITED; 52 typedef GrPathRenderer INHERITED;
50 }; 53 };
51 54
52 #endif 55 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/GrSoftwarePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698