/**
* Simple wrapper for the native GraphicBuffer class.
* @hide
*/
public class GraphicBuffer implements Parcelable {
...
private final int mWidth;
private final int mHeight;
private final int mFormat;
private final int mUsage;
// Note: do not rename, this field is used by native code
private final long mNativeObject;
// These two fields are only used by lock/unlockCanvas()
private Canvas mCanvas;
private int mSaveCount;
...
}
- GraphicBuffer 的宽高、像素格式、usage 等成员描述 buffer 属性。
mNativeObject
是 GraphicBufferWrapper 地址。
- 在
lockCanvas()
创建 mCanvas
。