| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkScanPriv.h" | 10 #include "SkScanPriv.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 public: | 46 public: |
| 47 BaseSuperBlitter(SkBlitter* realBlitter, const SkIRect& ir, | 47 BaseSuperBlitter(SkBlitter* realBlitter, const SkIRect& ir, |
| 48 const SkRegion& clip, bool isInverse); | 48 const SkRegion& clip, bool isInverse); |
| 49 | 49 |
| 50 /// Must be explicitly defined on subclasses. | 50 /// Must be explicitly defined on subclasses. |
| 51 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], | 51 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], |
| 52 const int16_t runs[]) SK_OVERRIDE { | 52 const int16_t runs[]) SK_OVERRIDE { |
| 53 SkDEBUGFAIL("How did I get here?"); | 53 SkDEBUGFAIL("How did I get here?"); |
| 54 } | 54 } |
| 55 /// May not be called on BaseSuperBlitter because it blits out of order. | 55 /// May not be called on BaseSuperBlitter because it blits out of order. |
| 56 virtual void blitV(int x, int y, int height, SkAlpha alpha) SK_OVERRIDE { | 56 void blitV(int x, int y, int height, SkAlpha alpha) SK_OVERRIDE { |
| 57 SkDEBUGFAIL("How did I get here?"); | 57 SkDEBUGFAIL("How did I get here?"); |
| 58 } | 58 } |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 SkBlitter* fRealBlitter; | 61 SkBlitter* fRealBlitter; |
| 62 /// Current y coordinate, in destination coordinates. | 62 /// Current y coordinate, in destination coordinates. |
| 63 int fCurrIY; | 63 int fCurrIY; |
| 64 /// Widest row of region to be blitted, in destination coordinates. | 64 /// Widest row of region to be blitted, in destination coordinates. |
| 65 int fWidth; | 65 int fWidth; |
| 66 /// Leftmost x coordinate in any row, in destination coordinates. | 66 /// Leftmost x coordinate in any row, in destination coordinates. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 virtual ~SuperBlitter() { | 113 virtual ~SuperBlitter() { |
| 114 this->flush(); | 114 this->flush(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 /// Once fRuns contains a complete supersampled row, flush() blits | 117 /// Once fRuns contains a complete supersampled row, flush() blits |
| 118 /// it out through the wrapped blitter. | 118 /// it out through the wrapped blitter. |
| 119 void flush(); | 119 void flush(); |
| 120 | 120 |
| 121 /// Blits a row of pixels, with location and width specified | 121 /// Blits a row of pixels, with location and width specified |
| 122 /// in supersampled coordinates. | 122 /// in supersampled coordinates. |
| 123 virtual void blitH(int x, int y, int width) SK_OVERRIDE; | 123 void blitH(int x, int y, int width) SK_OVERRIDE; |
| 124 /// Blits a rectangle of pixels, with location and size specified | 124 /// Blits a rectangle of pixels, with location and size specified |
| 125 /// in supersampled coordinates. | 125 /// in supersampled coordinates. |
| 126 virtual void blitRect(int x, int y, int width, int height) SK_OVERRIDE; | 126 void blitRect(int x, int y, int width, int height) SK_OVERRIDE; |
| 127 | 127 |
| 128 private: | 128 private: |
| 129 // The next three variables are used to track a circular buffer that | 129 // The next three variables are used to track a circular buffer that |
| 130 // contains the values used in SkAlphaRuns. These variables should only | 130 // contains the values used in SkAlphaRuns. These variables should only |
| 131 // ever be updated in advanceRuns(), and fRuns should always point to | 131 // ever be updated in advanceRuns(), and fRuns should always point to |
| 132 // a valid SkAlphaRuns... | 132 // a valid SkAlphaRuns... |
| 133 int fRunsToBuffer; | 133 int fRunsToBuffer; |
| 134 void* fRunsBuffer; | 134 void* fRunsBuffer; |
| 135 int fCurrentRun; | 135 int fCurrentRun; |
| 136 SkAlphaRuns fRuns; | 136 SkAlphaRuns fRuns; |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 /////////////////////////////////////////////////////////////////////////////// | 401 /////////////////////////////////////////////////////////////////////////////// |
| 402 | 402 |
| 403 /// Masked supersampling antialiased blitter. | 403 /// Masked supersampling antialiased blitter. |
| 404 class MaskSuperBlitter : public BaseSuperBlitter { | 404 class MaskSuperBlitter : public BaseSuperBlitter { |
| 405 public: | 405 public: |
| 406 MaskSuperBlitter(SkBlitter* realBlitter, const SkIRect& ir, const SkRegion&,
bool isInverse); | 406 MaskSuperBlitter(SkBlitter* realBlitter, const SkIRect& ir, const SkRegion&,
bool isInverse); |
| 407 virtual ~MaskSuperBlitter() { | 407 virtual ~MaskSuperBlitter() { |
| 408 fRealBlitter->blitMask(fMask, fClipRect); | 408 fRealBlitter->blitMask(fMask, fClipRect); |
| 409 } | 409 } |
| 410 | 410 |
| 411 virtual void blitH(int x, int y, int width) SK_OVERRIDE; | 411 void blitH(int x, int y, int width) SK_OVERRIDE; |
| 412 | 412 |
| 413 static bool CanHandleRect(const SkIRect& bounds) { | 413 static bool CanHandleRect(const SkIRect& bounds) { |
| 414 #ifdef FORCE_RLE | 414 #ifdef FORCE_RLE |
| 415 return false; | 415 return false; |
| 416 #endif | 416 #endif |
| 417 int width = bounds.width(); | 417 int width = bounds.width(); |
| 418 int64_t rb = SkAlign4(width); | 418 int64_t rb = SkAlign4(width); |
| 419 // use 64bits to detect overflow | 419 // use 64bits to detect overflow |
| 420 int64_t storage = rb * bounds.height(); | 420 int64_t storage = rb * bounds.height(); |
| 421 | 421 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 AntiFillPath(path, clip.bwRgn(), blitter); | 766 AntiFillPath(path, clip.bwRgn(), blitter); |
| 767 } else { | 767 } else { |
| 768 SkRegion tmp; | 768 SkRegion tmp; |
| 769 SkAAClipBlitter aaBlitter; | 769 SkAAClipBlitter aaBlitter; |
| 770 | 770 |
| 771 tmp.setRect(clip.getBounds()); | 771 tmp.setRect(clip.getBounds()); |
| 772 aaBlitter.init(blitter, &clip.aaRgn()); | 772 aaBlitter.init(blitter, &clip.aaRgn()); |
| 773 SkScan::AntiFillPath(path, tmp, &aaBlitter, true); | 773 SkScan::AntiFillPath(path, tmp, &aaBlitter, true); |
| 774 } | 774 } |
| 775 } | 775 } |
| OLD | NEW |