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

Unified Diff: src/gpu/GrSWMaskHelper.h

Issue 446103002: Pass compressed blitters to our mask drawing algorithm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrSWMaskHelper.cpp » ('j') | src/gpu/GrSWMaskHelper.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrSWMaskHelper.h
diff --git a/src/gpu/GrSWMaskHelper.h b/src/gpu/GrSWMaskHelper.h
index 4c06786280a4b11087ef669fbd56072dc27d384d..794e219a8130d9abe0bf6e9189c5d6ae5f37bae5 100644
--- a/src/gpu/GrSWMaskHelper.h
+++ b/src/gpu/GrSWMaskHelper.h
@@ -42,8 +42,13 @@ class GrDrawTarget;
class GrSWMaskHelper : SkNoncopyable {
public:
GrSWMaskHelper(GrContext* context)
- : fContext(context), fCompressMask(false) {
- }
+ : fContext(context)
+ , fCompressionMode(kNone_CompressionMode)
+ , fCompressedBuffer(NULL)
+ , fCompressedBlitter(NULL)
robertphillips 2014/08/06 20:54:49 '{' goes on line above
krajcevski 2014/08/06 22:41:59 Done.
+ { }
+
+ ~GrSWMaskHelper();
// set up the internal state in preparation for draws. Since many masks
// may be accumulated in the helper during creation, "resultBounds"
@@ -94,7 +99,6 @@ public:
GrDrawTarget* target,
const SkIRect& rect);
-protected:
private:
GrContext* fContext;
SkMatrix fMatrix;
@@ -102,12 +106,21 @@ private:
SkDraw fDraw;
SkRasterClip fRasterClip;
- // This flag says whether or not we should compress the mask. If
- // it is true, then fCompressedFormat is always valid.
- bool fCompressMask;
+ // This enum says whether or not we should compress the mask:
+ // kNone_CompressionMode: compression is not supported on this device.
+ // kCompress_CompressionMode: compress the bitmap before it gets sent to the gpu
+ // kBlitter_CompressionMode: write to the bitmap using a special compressed blitter.
+ enum CompressionMode {
+ kNone_CompressionMode,
+ kCompress_CompressionMode,
+ kBlitter_CompressionMode,
+ } fCompressionMode;
+
robertphillips 2014/08/06 20:54:49 // These two are only non-NULL is fCompressionMode
krajcevski 2014/08/06 22:41:59 Done.
+ void* fCompressedBuffer;
+ SkBlitter* fCompressedBlitter;
// This is the desired format within which to compress the
- // texture. This value is only valid if fCompressMask is true.
+ // texture. This value is only valid if fCompressionMode is not kNone_CompressionMode.
SkTextureCompressor::Format fCompressedFormat;
// Actually sends the texture data to the GPU. This is called from
« 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