Example usage for android.graphics Canvas isHardwareAccelerated

List of usage examples for android.graphics Canvas isHardwareAccelerated

Introduction

In this page you can find the example usage for android.graphics Canvas isHardwareAccelerated.

Prototype

public boolean isHardwareAccelerated() 

Source Link

Document

Indicates whether this Canvas uses hardware acceleration.

Usage

From source file:Main.java

/**
 * According to https://developer.android.com/guide/topics/graphics/hardware-accel.html#unsupported
 API 18 or higher supports clipPath to canvas based on hardware acceleration.
 * @param canvas//from  w  ww .jav a 2  s. c  o  m
 * @return
 */
private static boolean clipCanvasDueToAndroidVersion(Canvas canvas) {
    return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 || !canvas.isHardwareAccelerated();
}