Merge "Fix clang-tidy warnings in libs/hwui."
This commit is contained in:
@@ -77,7 +77,7 @@ public:
|
||||
void forceEndNow(AnimationContext& context);
|
||||
|
||||
protected:
|
||||
BaseRenderNodeAnimator(float finalValue);
|
||||
explicit BaseRenderNodeAnimator(float finalValue);
|
||||
virtual ~BaseRenderNodeAnimator();
|
||||
|
||||
virtual float getValue(RenderNode* target) const = 0;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace uirenderer {
|
||||
// Lifecycle
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void AssetAtlas::init(sp<GraphicBuffer> buffer, int64_t* map, int count) {
|
||||
void AssetAtlas::init(const sp<GraphicBuffer>& buffer, int64_t* map, int count) {
|
||||
if (mImage) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
* initialized. To re-initialize the atlas, you must
|
||||
* first call terminate().
|
||||
*/
|
||||
ANDROID_API void init(sp<GraphicBuffer> buffer, int64_t* map, int count);
|
||||
ANDROID_API void init(const sp<GraphicBuffer>& buffer, int64_t* map, int count);
|
||||
|
||||
/**
|
||||
* Destroys the atlas texture. This object can be
|
||||
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
class DrawOp : public DisplayListOp {
|
||||
friend class MergingDrawBatch;
|
||||
public:
|
||||
DrawOp(const SkPaint* paint)
|
||||
explicit DrawOp(const SkPaint* paint)
|
||||
: mPaint(paint), mQuickRejected(false) {}
|
||||
|
||||
virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
|
||||
@@ -245,7 +245,7 @@ public:
|
||||
}
|
||||
|
||||
// default empty constructor for bounds, to be overridden in child constructor body
|
||||
DrawBoundedOp(const SkPaint* paint): DrawOp(paint) { }
|
||||
explicit DrawBoundedOp(const SkPaint* paint): DrawOp(paint) { }
|
||||
|
||||
virtual bool getLocalBounds(Rect& localBounds) override {
|
||||
localBounds.set(mLocalBounds);
|
||||
@@ -270,7 +270,7 @@ protected:
|
||||
|
||||
class SaveOp : public StateOp {
|
||||
public:
|
||||
SaveOp(int flags)
|
||||
explicit SaveOp(int flags)
|
||||
: mFlags(flags) {}
|
||||
|
||||
virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
|
||||
@@ -296,7 +296,7 @@ private:
|
||||
|
||||
class RestoreToCountOp : public StateOp {
|
||||
public:
|
||||
RestoreToCountOp(int count)
|
||||
explicit RestoreToCountOp(int count)
|
||||
: mCount(count) {}
|
||||
|
||||
virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
|
||||
@@ -409,7 +409,7 @@ private:
|
||||
|
||||
class RotateOp : public StateOp {
|
||||
public:
|
||||
RotateOp(float degrees)
|
||||
explicit RotateOp(float degrees)
|
||||
: mDegrees(degrees) {}
|
||||
|
||||
virtual void applyState(OpenGLRenderer& renderer, int saveCount) const override {
|
||||
@@ -468,7 +468,7 @@ private:
|
||||
|
||||
class SetMatrixOp : public StateOp {
|
||||
public:
|
||||
SetMatrixOp(const SkMatrix& matrix)
|
||||
explicit SetMatrixOp(const SkMatrix& matrix)
|
||||
: mMatrix(matrix) {}
|
||||
|
||||
virtual void applyState(OpenGLRenderer& renderer, int saveCount) const override {
|
||||
@@ -491,7 +491,7 @@ private:
|
||||
|
||||
class SetLocalMatrixOp : public StateOp {
|
||||
public:
|
||||
SetLocalMatrixOp(const SkMatrix& matrix)
|
||||
explicit SetLocalMatrixOp(const SkMatrix& matrix)
|
||||
: mMatrix(matrix) {}
|
||||
|
||||
virtual void applyState(OpenGLRenderer& renderer, int saveCount) const override {
|
||||
@@ -510,7 +510,7 @@ private:
|
||||
|
||||
class ConcatMatrixOp : public StateOp {
|
||||
public:
|
||||
ConcatMatrixOp(const SkMatrix& matrix)
|
||||
explicit ConcatMatrixOp(const SkMatrix& matrix)
|
||||
: mMatrix(matrix) {}
|
||||
|
||||
virtual void applyState(OpenGLRenderer& renderer, int saveCount) const override {
|
||||
@@ -529,7 +529,7 @@ private:
|
||||
|
||||
class ClipOp : public StateOp {
|
||||
public:
|
||||
ClipOp(SkRegion::Op op) : mOp(op) {}
|
||||
explicit ClipOp(SkRegion::Op op) : mOp(op) {}
|
||||
|
||||
virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
|
||||
bool useQuickReject) override {
|
||||
@@ -1396,7 +1396,7 @@ private:
|
||||
|
||||
class DrawFunctorOp : public DrawOp {
|
||||
public:
|
||||
DrawFunctorOp(Functor* functor)
|
||||
explicit DrawFunctorOp(Functor* functor)
|
||||
: DrawOp(nullptr), mFunctor(functor) {}
|
||||
|
||||
virtual void applyDraw(OpenGLRenderer& renderer, Rect& dirty) override {
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
void endPrecaching() override;
|
||||
|
||||
private:
|
||||
ShaderGammaFontRenderer(bool multiGamma);
|
||||
explicit ShaderGammaFontRenderer(bool multiGamma);
|
||||
|
||||
FontRenderer* mRenderer;
|
||||
bool mMultiGamma;
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
* cannot be created, getTexture() will return 0 and getImage() will
|
||||
* return EGL_NO_IMAGE_KHR.
|
||||
*/
|
||||
Image(sp<GraphicBuffer> buffer);
|
||||
explicit Image(sp<GraphicBuffer> buffer);
|
||||
~Image();
|
||||
|
||||
/**
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
|
||||
class ANDROID_API AccelerateInterpolator : public Interpolator {
|
||||
public:
|
||||
AccelerateInterpolator(float factor) : mFactor(factor), mDoubleFactor(factor*2) {}
|
||||
explicit AccelerateInterpolator(float factor) : mFactor(factor), mDoubleFactor(factor*2) {}
|
||||
virtual float interpolate(float input) override;
|
||||
private:
|
||||
const float mFactor;
|
||||
@@ -52,7 +52,7 @@ private:
|
||||
|
||||
class ANDROID_API AnticipateInterpolator : public Interpolator {
|
||||
public:
|
||||
AnticipateInterpolator(float tension) : mTension(tension) {}
|
||||
explicit AnticipateInterpolator(float tension) : mTension(tension) {}
|
||||
virtual float interpolate(float input) override;
|
||||
private:
|
||||
const float mTension;
|
||||
@@ -60,7 +60,7 @@ private:
|
||||
|
||||
class ANDROID_API AnticipateOvershootInterpolator : public Interpolator {
|
||||
public:
|
||||
AnticipateOvershootInterpolator(float tension) : mTension(tension) {}
|
||||
explicit AnticipateOvershootInterpolator(float tension) : mTension(tension) {}
|
||||
virtual float interpolate(float input) override;
|
||||
private:
|
||||
const float mTension;
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
|
||||
class ANDROID_API CycleInterpolator : public Interpolator {
|
||||
public:
|
||||
CycleInterpolator(float cycles) : mCycles(cycles) {}
|
||||
explicit CycleInterpolator(float cycles) : mCycles(cycles) {}
|
||||
virtual float interpolate(float input) override;
|
||||
private:
|
||||
const float mCycles;
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
|
||||
class ANDROID_API DecelerateInterpolator : public Interpolator {
|
||||
public:
|
||||
DecelerateInterpolator(float factor) : mFactor(factor) {}
|
||||
explicit DecelerateInterpolator(float factor) : mFactor(factor) {}
|
||||
virtual float interpolate(float input) override;
|
||||
private:
|
||||
const float mFactor;
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
|
||||
class ANDROID_API OvershootInterpolator : public Interpolator {
|
||||
public:
|
||||
OvershootInterpolator(float tension) : mTension(tension) {}
|
||||
explicit OvershootInterpolator(float tension) : mTension(tension) {}
|
||||
virtual float interpolate(float input) override;
|
||||
private:
|
||||
const float mTension;
|
||||
|
||||
@@ -101,7 +101,7 @@ private:
|
||||
void resumeFromFunctorInvoke();
|
||||
void assertOnGLThread();
|
||||
|
||||
RenderState(renderthread::RenderThread& thread);
|
||||
explicit RenderState(renderthread::RenderThread& thread);
|
||||
~RenderState();
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
private:
|
||||
friend class RenderThread;
|
||||
|
||||
EglManager(RenderThread& thread);
|
||||
explicit EglManager(RenderThread& thread);
|
||||
// EglContext is never destroyed, method is purposely not implemented
|
||||
~EglManager();
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ bool TaskManager::WorkerThread::threadLoop() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TaskManager::WorkerThread::addTask(TaskWrapper task) {
|
||||
bool TaskManager::WorkerThread::addTask(const TaskWrapper& task) {
|
||||
if (!isRunning()) {
|
||||
run(mName.string(), PRIORITY_DEFAULT);
|
||||
} else if (exitPending()) {
|
||||
|
||||
@@ -77,9 +77,9 @@ private:
|
||||
|
||||
class WorkerThread: public Thread {
|
||||
public:
|
||||
explicit WorkerThread(const String8 name): mSignal(Condition::WAKE_UP_ONE), mName(name) { }
|
||||
explicit WorkerThread(const String8& name): mSignal(Condition::WAKE_UP_ONE), mName(name) { }
|
||||
|
||||
bool addTask(TaskWrapper task);
|
||||
bool addTask(const TaskWrapper& task);
|
||||
size_t getTaskCount() const;
|
||||
void exit();
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define TIME_METHOD() MethodTimer __method_timer(__func__)
|
||||
class MethodTimer {
|
||||
public:
|
||||
MethodTimer(const char* name)
|
||||
explicit MethodTimer(const char* name)
|
||||
: mMethodName(name) {
|
||||
gettimeofday(&mStart, nullptr);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ struct AaptGroupEntry
|
||||
{
|
||||
public:
|
||||
AaptGroupEntry() {}
|
||||
AaptGroupEntry(const ConfigDescription& config) : mParams(config) {}
|
||||
explicit AaptGroupEntry(const ConfigDescription& config) : mParams(config) {}
|
||||
|
||||
bool initFromDirName(const char* dir, String8* resType);
|
||||
|
||||
@@ -312,7 +312,7 @@ public:
|
||||
: isPublic(false), isJavaSymbol(false), typeCode(TYPE_UNKNOWN)
|
||||
{
|
||||
}
|
||||
AaptSymbolEntry(const String8& _name)
|
||||
explicit AaptSymbolEntry(const String8& _name)
|
||||
: name(_name), isPublic(false), isJavaSymbol(false), typeCode(TYPE_UNKNOWN)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user