reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 2 | * Copyright 2006 The Android Open Source Project |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 3 | * |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef SkTransparentShader_DEFINED |
| 9 | #define SkTransparentShader_DEFINED |
| 10 | |
| 11 | #include "SkShader.h" |
| 12 | |
tfarina@chromium.org | 6806fe8 | 2012-10-12 14:41:39 +0000 | [diff] [blame^] | 13 | class SK_API SkTransparentShader : public SkShader { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 14 | public: |
| 15 | SkTransparentShader() {} |
reed@google.com | 7716afb | 2011-12-07 15:17:50 +0000 | [diff] [blame] | 16 | |
| 17 | virtual uint32_t getFlags() SK_OVERRIDE; |
tfarina@chromium.org | 6806fe8 | 2012-10-12 14:41:39 +0000 | [diff] [blame^] | 18 | virtual bool setContext(const SkBitmap& device, |
| 19 | const SkPaint& paint, |
| 20 | const SkMatrix& matrix) SK_OVERRIDE; |
reed@google.com | 7716afb | 2011-12-07 15:17:50 +0000 | [diff] [blame] | 21 | virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE; |
| 22 | virtual void shadeSpan16(int x, int y, uint16_t span[], int count) SK_OVERRIDE; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 23 | |
djsollen@google.com | ba28d03 | 2012-03-26 17:57:35 +0000 | [diff] [blame] | 24 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTransparentShader) |
reed@google.com | 7716afb | 2011-12-07 15:17:50 +0000 | [diff] [blame] | 25 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 26 | private: |
| 27 | // these are a cache from the call to setContext() |
| 28 | const SkBitmap* fDevice; |
| 29 | uint8_t fAlpha; |
| 30 | |
| 31 | SkTransparentShader(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 32 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 33 | typedef SkShader INHERITED; |
| 34 | }; |
| 35 | |
| 36 | #endif |