Stan Iliev | 11606ff | 2018-09-17 14:01:16 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #pragma once |
| 18 | |
| 19 | #include "FunctorDrawable.h" |
| 20 | |
Stan Iliev | 11606ff | 2018-09-17 14:01:16 -0400 | [diff] [blame] | 21 | #include <ui/GraphicBuffer.h> |
John Reck | 283bb46 | 2018-12-13 16:40:14 -0800 | [diff] [blame] | 22 | #include <utils/RefBase.h> |
Stan Iliev | 11606ff | 2018-09-17 14:01:16 -0400 | [diff] [blame] | 23 | |
| 24 | namespace android { |
| 25 | namespace uirenderer { |
| 26 | |
| 27 | namespace skiapipeline { |
| 28 | |
| 29 | /** |
| 30 | * This drawable wraps a Vulkan functor enabling it to be recorded into a list |
| 31 | * of Skia drawing commands. |
| 32 | */ |
Chris Blume | 5f1ac2b | 2018-11-05 16:10:39 -0800 | [diff] [blame] | 33 | class VkInteropFunctorDrawable : public FunctorDrawable { |
Stan Iliev | 11606ff | 2018-09-17 14:01:16 -0400 | [diff] [blame] | 34 | public: |
John Reck | 283bb46 | 2018-12-13 16:40:14 -0800 | [diff] [blame] | 35 | using FunctorDrawable::FunctorDrawable; |
| 36 | |
Chris Blume | 5f1ac2b | 2018-11-05 16:10:39 -0800 | [diff] [blame] | 37 | virtual ~VkInteropFunctorDrawable(); |
Stan Iliev | 11606ff | 2018-09-17 14:01:16 -0400 | [diff] [blame] | 38 | |
Stan Iliev | 11606ff | 2018-09-17 14:01:16 -0400 | [diff] [blame] | 39 | static void vkInvokeFunctor(Functor* functor); |
| 40 | |
John Reck | 283bb46 | 2018-12-13 16:40:14 -0800 | [diff] [blame] | 41 | void syncFunctor(const WebViewSyncData& data) const override; |
| 42 | |
Stan Iliev | 11606ff | 2018-09-17 14:01:16 -0400 | [diff] [blame] | 43 | protected: |
| 44 | virtual void onDraw(SkCanvas* canvas) override; |
| 45 | |
| 46 | private: |
Stan Iliev | 11606ff | 2018-09-17 14:01:16 -0400 | [diff] [blame] | 47 | // Variables below describe/store temporary offscreen buffer used for Vulkan pipeline. |
| 48 | sp<GraphicBuffer> mFrameBuffer; |
| 49 | SkImageInfo mFBInfo; |
| 50 | }; |
| 51 | |
Chris Blume | 7b8a808 | 2018-11-30 15:51:58 -0800 | [diff] [blame] | 52 | } // namespace skiapipeline |
| 53 | } // namespace uirenderer |
| 54 | } // namespace android |