| 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 #ifndef SkBitmapProcShader_DEFINED | 10 #ifndef SkBitmapProcShader_DEFINED |
| 11 #define SkBitmapProcShader_DEFINED | 11 #define SkBitmapProcShader_DEFINED |
| 12 | 12 |
| 13 #include "SkShader.h" | 13 #include "SkShader.h" |
| 14 #include "SkSmallAllocator.h" | 14 #include "SkSmallAllocator.h" |
| 15 | 15 |
| 16 struct SkBitmapProcState; | 16 struct SkBitmapProcState; |
| 17 class SkBitmapProvider; | 17 class SkBitmapProvider; |
| 18 | 18 |
| 19 class SkBitmapProcShader : public SkShader { | 19 class SkBitmapProcShader : public SkShader { |
| 20 public: | 20 public: |
| 21 SkBitmapProcShader(const SkBitmap& src, TileMode tx, TileMode ty, | 21 SkBitmapProcShader(const SkBitmap& src, TileMode tx, TileMode ty, |
| 22 const SkMatrix* localMatrix = nullptr); | 22 const SkMatrix* localMatrix = nullptr); |
| 23 | 23 |
| 24 bool isOpaque() const override; | 24 bool isOpaque() const override; |
| 25 | 25 |
| 26 size_t contextSize() const override { return ContextSize(); } | 26 size_t contextSize(const ContextRec&) const override { return ContextSize();
} |
| 27 | 27 |
| 28 SK_TO_STRING_OVERRIDE() | 28 SK_TO_STRING_OVERRIDE() |
| 29 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapProcShader) | 29 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapProcShader) |
| 30 | 30 |
| 31 #if SK_SUPPORT_GPU | 31 #if SK_SUPPORT_GPU |
| 32 const GrFragmentProcessor* asFragmentProcessor(GrContext*, const SkMatrix& v
iewM, | 32 const GrFragmentProcessor* asFragmentProcessor(GrContext*, const SkMatrix& v
iewM, |
| 33 const SkMatrix*, SkFilterQual
ity) const override; | 33 const SkMatrix*, SkFilterQual
ity) const override; |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 protected: | 36 protected: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // Note that some contexts may contain other contexts (e.g. for compose shaders)
, but we've not | 76 // Note that some contexts may contain other contexts (e.g. for compose shaders)
, but we've not |
| 77 // yet found a situation where the size below isn't big enough. | 77 // yet found a situation where the size below isn't big enough. |
| 78 typedef SkSmallAllocator<3, 1280> SkTBlitterAllocator; | 78 typedef SkSmallAllocator<3, 1280> SkTBlitterAllocator; |
| 79 | 79 |
| 80 // If alloc is non-nullptr, it will be used to allocate the returned SkShader, a
nd MUST outlive | 80 // If alloc is non-nullptr, it will be used to allocate the returned SkShader, a
nd MUST outlive |
| 81 // the SkShader. | 81 // the SkShader. |
| 82 SkShader* SkCreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader
::TileMode, | 82 SkShader* SkCreateBitmapShader(const SkBitmap& src, SkShader::TileMode, SkShader
::TileMode, |
| 83 const SkMatrix* localMatrix, SkTBlitterAllocator*
alloc); | 83 const SkMatrix* localMatrix, SkTBlitterAllocator*
alloc); |
| 84 | 84 |
| 85 #endif | 85 #endif |
| OLD | NEW |