Trace解析

本文介绍了在Android源码中遇到的Trace.traceBegin和Trace.traceEnd方法,它们用于性能分析。TraceView是一个图形化的性能分析工具,而Systrace则允许通过图形化方式查看跨进程的事件。Trace.traceBegin标志着代码开始运行,traceEnd表示结束,两者需成对使用并传递相同的tag。这些追踪事件可以被atrace工具用于离线分析。源码深入后发现,Trace机制在Native层也有实现,暗示学习C++和NDK的重要性。
摘要由CSDN通过智能技术生成

今天在读关于图片解析的源码,看到这样的代码:

/**
     * Decode an input stream into a bitmap. If the input stream is null, or
     * cannot be used to decode a bitmap, the function returns null.
     * The stream's position will be where ever it was after the encoded data
     * was read.
     *
     * @param is The input stream that holds the raw data to be decoded into a
     *           bitmap.
     * @param outPadding If not null, return the padding rect for the bitmap if
     *                   it exists, otherwise set padding to [-1,-1,-1,-1]. If
     *                   no bitmap is returned (null) then padding is
     *                   unchanged.
     * @param opts null-ok; Options that control downsampling and whether the
     *             image should be completely decoded, or just is size returned.
     * @return The decoded bitmap, or null if the image data could not be
     *         decoded, or, if opts is non-null, if opts requested only the
     *         size be returned (
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值