| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#pragma once |
| 18 |
|
| 19 |
#include "FunctorDrawable.h" |
| 20 |
|
| 21 |
#include <SkImageInfo.h> |
| 22 |
#include <utils/RefBase.h> |
| 23 |
|
| 24 |
namespace android { |
| 25 |
namespace uirenderer { |
| 26 |
namespace skiapipeline { |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
class VkFunctorDrawHandler : public FunctorDrawable::GpuDrawHandler { |
| 33 |
public: |
| 34 |
VkFunctorDrawHandler(sp<WebViewFunctor::Handle> functor_handle, const SkMatrix& matrix, |
| 35 |
const SkIRect& clip, const SkImageInfo& image_info); |
| 36 |
~VkFunctorDrawHandler() override; |
| 37 |
|
| 38 |
void draw(const GrBackendDrawableInfo& info) override; |
| 39 |
|
| 40 |
private: |
| 41 |
typedef GpuDrawHandler INHERITED; |
| 42 |
sp<WebViewFunctor::Handle> mFunctorHandle; |
| 43 |
const SkMatrix mMatrix; |
| 44 |
const SkIRect mClip; |
| 45 |
const SkImageInfo mImageInfo; |
| 46 |
|
| 47 |
bool mDrawn = false; |
| 48 |
}; |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
class VkFunctorDrawable : public FunctorDrawable { |
| 55 |
public: |
| 56 |
using FunctorDrawable::FunctorDrawable; |
| 57 |
|
| 58 |
~VkFunctorDrawable() override; |
| 59 |
|
| 60 |
protected: |
| 61 |
|
| 62 |
void onDraw(SkCanvas* canvas) override; |
| 63 |
std::unique_ptr<FunctorDrawable::GpuDrawHandler> onSnapGpuDrawHandler( |
| 64 |
GrBackendApi backendApi, const SkMatrix& matrix, const SkIRect& clip, |
| 65 |
const SkImageInfo& image_info) override; |
| 66 |
}; |
| 67 |
|
| 68 |
} |
| 69 |
} |
| 70 |
} |