aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSWMaskHelper.h
diff options
context:
space:
mode:
authorGravatar krajcevski <krajcevski@google.com>2014-08-07 08:15:14 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-07 08:15:14 -0700
commitb8ccc2f6d258a8466f79fc418e9e0a55aeaf58ce (patch)
tree1e859270a248919ef5f5562fe576958384b8abeb /src/gpu/GrSWMaskHelper.h
parent963137b75c0a1fe91f35e9826742f36309f5e65d (diff)
Pass compressed blitters to our mask drawing algorithm
R=robertphillips@google.com, reed@google.com Author: krajcevski@google.com Review URL: https://codereview.chromium.org/446103002
Diffstat (limited to 'src/gpu/GrSWMaskHelper.h')
-rw-r--r--src/gpu/GrSWMaskHelper.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/gpu/GrSWMaskHelper.h b/src/gpu/GrSWMaskHelper.h
index 4c06786280..ccd2df865e 100644
--- a/src/gpu/GrSWMaskHelper.h
+++ b/src/gpu/GrSWMaskHelper.h
@@ -42,7 +42,8 @@ class GrDrawTarget;
class GrSWMaskHelper : SkNoncopyable {
public:
GrSWMaskHelper(GrContext* context)
- : fContext(context), fCompressMask(false) {
+ : fContext(context)
+ , fCompressionMode(kNone_CompressionMode) {
}
// set up the internal state in preparation for draws. Since many masks
@@ -94,7 +95,6 @@ public:
GrDrawTarget* target,
const SkIRect& rect);
-protected:
private:
GrContext* fContext;
SkMatrix fMatrix;
@@ -102,12 +102,22 @@ 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;
+
+ // This is the buffer into which we store our compressed data. This buffer is
+ // only allocated (non-null) if fCompressionMode is kBlitter_CompressionMode
+ SkAutoMalloc fCompressedBuffer;
// 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