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

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

Issue 330593004: Use scratch with LATC data if possible (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | src/gpu/GrSWMaskHelper.cpp » ('j') | src/gpu/GrSWMaskHelper.cpp » ('J')
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 GrSWMaskHelper_DEFINED 8 #ifndef GrSWMaskHelper_DEFINED
9 #define GrSWMaskHelper_DEFINED 9 #define GrSWMaskHelper_DEFINED
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // Draw a single path into the accumuation bitmap using the specified op 57 // Draw a single path into the accumuation bitmap using the specified op
58 void draw(const SkPath& path, const SkStrokeRec& stroke, SkRegion::Op op, 58 void draw(const SkPath& path, const SkStrokeRec& stroke, SkRegion::Op op,
59 bool antiAlias, uint8_t alpha); 59 bool antiAlias, uint8_t alpha);
60 60
61 // Helper function to get a scratch texture suitable for capturing the 61 // Helper function to get a scratch texture suitable for capturing the
62 // result (i.e., right size & format) 62 // result (i.e., right size & format)
63 bool getTexture(GrAutoScratchTexture* texture); 63 bool getTexture(GrAutoScratchTexture* texture);
64 64
65 // Move the mask generation results from the internal bitmap to the gpu. 65 // Move the mask generation results from the internal bitmap to the gpu.
66 void toTexture(GrTexture* texture); 66 void toTexture(GrTexture* texture);
67 67 void toLATCTexture(GrTexture* texture);
68 GrTexture* toLATCTexture(GrContext* ctx);
69 68
70 // Reset the internal bitmap 69 // Reset the internal bitmap
71 void clear(uint8_t alpha) { 70 void clear(uint8_t alpha) {
72 fBM.eraseColor(SkColorSetARGB(alpha, alpha, alpha, alpha)); 71 fBM.eraseColor(SkColorSetARGB(alpha, alpha, alpha, alpha));
73 } 72 }
74 73
75 // Canonical usage utility that draws a single path and uploads it 74 // Canonical usage utility that draws a single path and uploads it
76 // to the GPU. The result is returned in "result". 75 // to the GPU. The result is returned in "result".
77 static GrTexture* DrawPathMaskToTexture(GrContext* context, 76 static GrTexture* DrawPathMaskToTexture(GrContext* context,
78 const SkPath& path, 77 const SkPath& path,
(...skipping 21 matching lines...) Expand all
100 GrContext* fContext; 99 GrContext* fContext;
101 SkMatrix fMatrix; 100 SkMatrix fMatrix;
102 SkBitmap fBM; 101 SkBitmap fBM;
103 SkDraw fDraw; 102 SkDraw fDraw;
104 SkRasterClip fRasterClip; 103 SkRasterClip fRasterClip;
105 104
106 typedef SkNoncopyable INHERITED; 105 typedef SkNoncopyable INHERITED;
107 }; 106 };
108 107
109 #endif // GrSWMaskHelper_DEFINED 108 #endif // GrSWMaskHelper_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrSWMaskHelper.cpp » ('j') | src/gpu/GrSWMaskHelper.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698