skia2/include/android/SkAndroidFrameworkUtils.h
Stan Iliev 73d8fd9065 Add a private API for writing the clip to the stencil
Add a private API used by Android framework, which writes the clip
into a stencil buffer. This is used by HWUI to clip the WebView.

Bug: 31489986
Change-Id: I94515f1539acd9d069c8aceb3300577feed9c94f
Reviewed-on: https://skia-review.googlesource.com/29521
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2017-08-02 19:56:07 +00:00

39 lines
928 B
C++

/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkAndroidFrameworkUtils_DEFINED
#define SkAndroidFrameworkUtils_DEFINED
#include "SkTypes.h"
#ifdef SK_BUILD_FOR_ANDROID
class SkCanvas;
/**
* SkAndroidFrameworkUtils expose private APIs used only by Android framework.
*/
class SkAndroidFrameworkUtils {
public:
#if SK_SUPPORT_GPU
/**
* clipWithStencil draws the current clip into a stencil buffer with reference value and mask
* set to 0x1. This function works only on a GPU canvas.
*
* @param canvas A GPU canvas that has a non-empty clip.
*
* @return true on success or false if clip is empty or not a GPU canvas.
*/
static bool clipWithStencil(SkCanvas* canvas);
#endif //SK_SUPPORT_GPU
};
#endif // SK_BUILD_FOR_ANDROID
#endif // SkAndroidFrameworkUtils_DEFINED