• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 /**
20  * Verify if the provided vendor and version supports RenderEffect caching
21  * behavior.
22  *
23  * Certain Open GL Driver implementations run into blocking scenarios
24  * with Fence::waitForever without a corresponding signal to unblock
25  * This happens during attempts to cache SkImage instances across frames
26  * especially in circumstances using RenderEffect/SkImageFilter internally.
27  * So detect the corresponding GL Vendor and driver version to determine if
28  * caching SkImage instances across frames is supported.
29  * See b/197263715 & b/193145089
30  * @param vendor Vendor of the GL driver
31  * @param version Version of the GL driver from the given vendor
32  * @return True if a RenderEffect result can be cached across frames,
33  * false otherwise
34  */
35 bool supportsRenderEffectCache(const char* vendor, const char* version);
36