Merge "Revert "Frameworks/base: Unused parameters in hwui""

This commit is contained in:
John Reck
2014-11-22 00:10:45 +00:00
committed by Gerrit Code Review
25 changed files with 180 additions and 196 deletions

View File

@@ -6,6 +6,8 @@ LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
# getConfig in external/skia/include/core/SkBitmap.h is deprecated. # getConfig in external/skia/include/core/SkBitmap.h is deprecated.
# Allow Gnu extension: in-class initializer of static 'const float' member. # Allow Gnu extension: in-class initializer of static 'const float' member.
LOCAL_CLANG_CFLAGS += \ LOCAL_CLANG_CFLAGS += \
-Wno-unused-parameter \
-Wno-deprecated-declarations \
-Wno-gnu-static-float-init -Wno-gnu-static-float-init
# Only build libhwui when USE_OPENGL_RENDERER is # Only build libhwui when USE_OPENGL_RENDERER is

View File

@@ -54,7 +54,7 @@ void AnimationContext::addAnimationHandle(AnimationHandle* handle) {
handle->insertAfter(&mNextFrameAnimations); handle->insertAfter(&mNextFrameAnimations);
} }
void AnimationContext::startFrame(TreeInfo::TraversalMode /* mode */) { void AnimationContext::startFrame(TreeInfo::TraversalMode mode) {
LOG_ALWAYS_FATAL_IF(mCurrentFrameAnimations.mNextHandle, LOG_ALWAYS_FATAL_IF(mCurrentFrameAnimations.mNextHandle,
"Missed running animations last frame!"); "Missed running animations last frame!");
AnimationHandle* head = mNextFrameAnimations.mNextHandle; AnimationHandle* head = mNextFrameAnimations.mNextHandle;

View File

@@ -245,11 +245,11 @@ CanvasPropertyPrimitiveAnimator::CanvasPropertyPrimitiveAnimator(
, mProperty(property) { , mProperty(property) {
} }
float CanvasPropertyPrimitiveAnimator::getValue(RenderNode* /* target */) const { float CanvasPropertyPrimitiveAnimator::getValue(RenderNode* target) const {
return mProperty->value; return mProperty->value;
} }
void CanvasPropertyPrimitiveAnimator::setValue(RenderNode* /* target */, float value) { void CanvasPropertyPrimitiveAnimator::setValue(RenderNode* target, float value) {
mProperty->value = value; mProperty->value = value;
} }
@@ -268,7 +268,7 @@ CanvasPropertyPaintAnimator::CanvasPropertyPaintAnimator(
, mField(field) { , mField(field) {
} }
float CanvasPropertyPaintAnimator::getValue(RenderNode* /* target */) const { float CanvasPropertyPaintAnimator::getValue(RenderNode* target) const {
switch (mField) { switch (mField) {
case STROKE_WIDTH: case STROKE_WIDTH:
return mProperty->value.getStrokeWidth(); return mProperty->value.getStrokeWidth();
@@ -284,7 +284,7 @@ static uint8_t to_uint8(float value) {
return static_cast<uint8_t>( c < 0 ? 0 : c > 255 ? 255 : c ); return static_cast<uint8_t>( c < 0 ? 0 : c > 255 ? 255 : c );
} }
void CanvasPropertyPaintAnimator::setValue(RenderNode* /* target */, float value) { void CanvasPropertyPaintAnimator::setValue(RenderNode* target, float value) {
switch (mField) { switch (mField) {
case STROKE_WIDTH: case STROKE_WIDTH:
mProperty->value.setStrokeWidth(value); mProperty->value.setStrokeWidth(value);

View File

@@ -385,13 +385,13 @@ private:
bool bindIndicesBufferInternal(const GLuint buffer); bool bindIndicesBufferInternal(const GLuint buffer);
static void eventMarkNull(GLsizei /* length */, const GLchar* /* marker */) { } static void eventMarkNull(GLsizei length, const GLchar* marker) { }
static void startMarkNull(GLsizei /* length */, const GLchar* /* marker */) { } static void startMarkNull(GLsizei length, const GLchar* marker) { }
static void endMarkNull() { } static void endMarkNull() { }
static void setLabelNull(GLenum /* type */, uint /* object */, GLsizei /* length */, static void setLabelNull(GLenum type, uint object, GLsizei length,
const char* /* label */) { } const char* label) { }
static void getLabelNull(GLenum /* type */, uint /* object */, GLsizei /* bufferSize */, static void getLabelNull(GLenum type, uint object, GLsizei bufferSize,
GLsizei* length, char* label) { GLsizei* length, char* label) {
if (length) *length = 0; if (length) *length = 0;
if (label) *label = '\0'; if (label) *label = '\0';

View File

@@ -55,7 +55,7 @@ public:
virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) = 0; virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) = 0;
virtual ~Batch() {} virtual ~Batch() {}
virtual bool purelyDrawBatch() { return false; } virtual bool purelyDrawBatch() { return false; }
virtual bool coversBounds(const Rect& /* bounds */) { return false; } virtual bool coversBounds(const Rect& bounds) { return false; }
}; };
class DrawBatch : public Batch { class DrawBatch : public Batch {
@@ -91,7 +91,7 @@ public:
return false; return false;
} }
virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int /* index */) { virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
DEFER_LOGD("%d replaying DrawBatch %p, with %d ops (batch id %x, merge id %p)", DEFER_LOGD("%d replaying DrawBatch %p, with %d ops (batch id %x, merge id %p)",
index, this, mOps.size(), getBatchId(), getMergeId()); index, this, mOps.size(), getBatchId(), getMergeId());
@@ -269,7 +269,7 @@ public:
if (newClipSideFlags & kClipSide_Bottom) mClipRect.bottom = state->mClip.bottom; if (newClipSideFlags & kClipSide_Bottom) mClipRect.bottom = state->mClip.bottom;
} }
virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int /* index */) { virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
DEFER_LOGD("%d replaying MergingDrawBatch %p, with %d ops," DEFER_LOGD("%d replaying MergingDrawBatch %p, with %d ops,"
" clip flags %x (batch id %x, merge id %p)", " clip flags %x (batch id %x, merge id %p)",
index, this, mOps.size(), mClipSideFlags, getBatchId(), getMergeId()); index, this, mOps.size(), mClipSideFlags, getBatchId(), getMergeId());
@@ -313,7 +313,7 @@ public:
// creates a single operation batch // creates a single operation batch
StateOpBatch(const StateOp* op, const DeferredDisplayState* state) : mOp(op), mState(state) {} StateOpBatch(const StateOp* op, const DeferredDisplayState* state) : mOp(op), mState(state) {}
virtual status_t replay(OpenGLRenderer& renderer, Rect& /* dirty */, int /* index */) { virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
DEFER_LOGD("replaying state op batch %p", this); DEFER_LOGD("replaying state op batch %p", this);
renderer.restoreDisplayState(*mState); renderer.restoreDisplayState(*mState);
@@ -332,10 +332,10 @@ private:
class RestoreToCountBatch : public Batch { class RestoreToCountBatch : public Batch {
public: public:
RestoreToCountBatch(const StateOp* /* op */, const DeferredDisplayState* state, RestoreToCountBatch(const StateOp* op, const DeferredDisplayState* state, int restoreCount) :
int restoreCount) : mState(state), mRestoreCount(restoreCount) {} mState(state), mRestoreCount(restoreCount) {}
virtual status_t replay(OpenGLRenderer& renderer, Rect& /* dirty */, int /* index */) { virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
DEFER_LOGD("batch %p restoring to count %d", this, mRestoreCount); DEFER_LOGD("batch %p restoring to count %d", this, mRestoreCount);
renderer.restoreDisplayState(*mState); renderer.restoreDisplayState(*mState);

View File

@@ -63,7 +63,7 @@ public:
// These objects should always be allocated with a LinearAllocator, and never destroyed/deleted. // These objects should always be allocated with a LinearAllocator, and never destroyed/deleted.
// standard new() intentionally not implemented, and delete/deconstructor should never be used. // standard new() intentionally not implemented, and delete/deconstructor should never be used.
virtual ~DisplayListOp() { CRASH(); } virtual ~DisplayListOp() { CRASH(); }
static void operator delete(void* /* ptr */) { CRASH(); } static void operator delete(void* ptr) { CRASH(); }
/** static void* operator new(size_t size); PURPOSELY OMITTED **/ /** static void* operator new(size_t size); PURPOSELY OMITTED **/
static void* operator new(size_t size, LinearAllocator& allocator) { static void* operator new(size_t size, LinearAllocator& allocator) {
return allocator.alloc(size); return allocator.alloc(size);
@@ -93,8 +93,8 @@ public:
virtual ~StateOp() {} virtual ~StateOp() {}
virtual void defer(DeferStateStruct& deferStruct, int saveCount, int /* level */, virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
bool /* useQuickReject */) { bool useQuickReject) {
// default behavior only affects immediate, deferrable state, issue directly to renderer // default behavior only affects immediate, deferrable state, issue directly to renderer
applyState(deferStruct.mRenderer, saveCount); applyState(deferStruct.mRenderer, saveCount);
} }
@@ -103,8 +103,8 @@ public:
* State operations are applied directly to the renderer, but can cause the deferred drawing op * State operations are applied directly to the renderer, but can cause the deferred drawing op
* list to flush * list to flush
*/ */
virtual void replay(ReplayStateStruct& replayStruct, int saveCount, int /* level */, virtual void replay(ReplayStateStruct& replayStruct, int saveCount, int level,
bool /* useQuickReject */) { bool useQuickReject) {
applyState(replayStruct.mRenderer, saveCount); applyState(replayStruct.mRenderer, saveCount);
} }
@@ -117,7 +117,7 @@ public:
DrawOp(const SkPaint* paint) DrawOp(const SkPaint* paint)
: mPaint(paint), mQuickRejected(false) {} : mPaint(paint), mQuickRejected(false) {}
virtual void defer(DeferStateStruct& deferStruct, int /* saveCount */, int /* level */, virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
bool useQuickReject) { bool useQuickReject) {
if (mQuickRejected && CC_LIKELY(useQuickReject)) { if (mQuickRejected && CC_LIKELY(useQuickReject)) {
return; return;
@@ -126,7 +126,7 @@ public:
deferStruct.mDeferredList.addDrawOp(deferStruct.mRenderer, this); deferStruct.mDeferredList.addDrawOp(deferStruct.mRenderer, this);
} }
virtual void replay(ReplayStateStruct& replayStruct, int /* saveCount */, int /* level */, virtual void replay(ReplayStateStruct& replayStruct, int saveCount, int level,
bool useQuickReject) { bool useQuickReject) {
if (mQuickRejected && CC_LIKELY(useQuickReject)) { if (mQuickRejected && CC_LIKELY(useQuickReject)) {
return; return;
@@ -145,7 +145,7 @@ public:
* reducing which operations are tagged as mergeable. * reducing which operations are tagged as mergeable.
*/ */
virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& dirty, virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& dirty,
const Vector<OpStatePair>& ops, const Rect& /* bounds */) { const Vector<OpStatePair>& ops, const Rect& bounds) {
status_t status = DrawGlInfo::kStatusDone; status_t status = DrawGlInfo::kStatusDone;
for (unsigned int i = 0; i < ops.size(); i++) { for (unsigned int i = 0; i < ops.size(); i++) {
renderer.restoreDisplayState(*(ops[i].state), true); renderer.restoreDisplayState(*(ops[i].state), true);
@@ -164,15 +164,15 @@ public:
* *
* if a subclass can set deferInfo.mergeable to true, it should implement multiDraw() * if a subclass can set deferInfo.mergeable to true, it should implement multiDraw()
*/ */
virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& /* deferInfo */, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& /* state */) {} const DeferredDisplayState& state) {}
/** /**
* Query the conservative, local bounds (unmapped) bounds of the op. * Query the conservative, local bounds (unmapped) bounds of the op.
* *
* returns true if bounds exist * returns true if bounds exist
*/ */
virtual bool getLocalBounds(Rect& /* localBounds */) { virtual bool getLocalBounds(Rect& localBounds) {
return false; return false;
} }
@@ -282,17 +282,17 @@ public:
SaveOp(int flags) SaveOp(int flags)
: mFlags(flags) {} : mFlags(flags) {}
virtual void defer(DeferStateStruct& deferStruct, int /* saveCount */, int /* level */, virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
bool /* useQuickReject */) { bool useQuickReject) {
int newSaveCount = deferStruct.mRenderer.save(mFlags); int newSaveCount = deferStruct.mRenderer.save(mFlags);
deferStruct.mDeferredList.addSave(deferStruct.mRenderer, this, newSaveCount); deferStruct.mDeferredList.addSave(deferStruct.mRenderer, this, newSaveCount);
} }
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.save(mFlags); renderer.save(mFlags);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Save flags %x", mFlags); OP_LOG("Save flags %x", mFlags);
} }
@@ -308,8 +308,8 @@ public:
RestoreToCountOp(int count) RestoreToCountOp(int count)
: mCount(count) {} : mCount(count) {}
virtual void defer(DeferStateStruct& deferStruct, int saveCount, int /* level */, virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
bool /* useQuickReject */) { bool useQuickReject) {
deferStruct.mDeferredList.addRestoreToCount(deferStruct.mRenderer, deferStruct.mDeferredList.addRestoreToCount(deferStruct.mRenderer,
this, saveCount + mCount); this, saveCount + mCount);
deferStruct.mRenderer.restoreToCount(saveCount + mCount); deferStruct.mRenderer.restoreToCount(saveCount + mCount);
@@ -319,7 +319,7 @@ public:
renderer.restoreToCount(saveCount + mCount); renderer.restoreToCount(saveCount + mCount);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Restore to count %d", mCount); OP_LOG("Restore to count %d", mCount);
} }
@@ -346,8 +346,8 @@ public:
, mConvexMask(NULL) , mConvexMask(NULL)
{} {}
virtual void defer(DeferStateStruct& deferStruct, int /* saveCount */, int /* level */, virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
bool /* useQuickReject */) { bool useQuickReject) {
// NOTE: don't bother with actual saveLayer, instead issuing it at flush time // NOTE: don't bother with actual saveLayer, instead issuing it at flush time
int newSaveCount = deferStruct.mRenderer.getSaveCount(); int newSaveCount = deferStruct.mRenderer.getSaveCount();
deferStruct.mDeferredList.addSaveLayer(deferStruct.mRenderer, this, newSaveCount); deferStruct.mDeferredList.addSaveLayer(deferStruct.mRenderer, this, newSaveCount);
@@ -358,12 +358,12 @@ public:
mPaint, mFlags); mPaint, mFlags);
} }
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.saveLayer(mArea.left, mArea.top, mArea.right, mArea.bottom, renderer.saveLayer(mArea.left, mArea.top, mArea.right, mArea.bottom,
mPaint, mFlags, mConvexMask); mPaint, mFlags, mConvexMask);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("SaveLayer%s of area " RECT_STRING, OP_LOG("SaveLayer%s of area " RECT_STRING,
(isSaveLayerAlpha() ? "Alpha" : ""),RECT_ARGS(mArea)); (isSaveLayerAlpha() ? "Alpha" : ""),RECT_ARGS(mArea));
} }
@@ -399,11 +399,11 @@ public:
TranslateOp(float dx, float dy) TranslateOp(float dx, float dy)
: mDx(dx), mDy(dy) {} : mDx(dx), mDy(dy) {}
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.translate(mDx, mDy); renderer.translate(mDx, mDy);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Translate by %f %f", mDx, mDy); OP_LOG("Translate by %f %f", mDx, mDy);
} }
@@ -419,11 +419,11 @@ public:
RotateOp(float degrees) RotateOp(float degrees)
: mDegrees(degrees) {} : mDegrees(degrees) {}
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.rotate(mDegrees); renderer.rotate(mDegrees);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Rotate by %f degrees", mDegrees); OP_LOG("Rotate by %f degrees", mDegrees);
} }
@@ -438,11 +438,11 @@ public:
ScaleOp(float sx, float sy) ScaleOp(float sx, float sy)
: mSx(sx), mSy(sy) {} : mSx(sx), mSy(sy) {}
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.scale(mSx, mSy); renderer.scale(mSx, mSy);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Scale by %f %f", mSx, mSy); OP_LOG("Scale by %f %f", mSx, mSy);
} }
@@ -458,11 +458,11 @@ public:
SkewOp(float sx, float sy) SkewOp(float sx, float sy)
: mSx(sx), mSy(sy) {} : mSx(sx), mSy(sy) {}
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.skew(mSx, mSy); renderer.skew(mSx, mSy);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Skew by %f %f", mSx, mSy); OP_LOG("Skew by %f %f", mSx, mSy);
} }
@@ -478,11 +478,11 @@ public:
SetMatrixOp(const SkMatrix& matrix) SetMatrixOp(const SkMatrix& matrix)
: mMatrix(matrix) {} : mMatrix(matrix) {}
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.setMatrix(mMatrix); renderer.setMatrix(mMatrix);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
if (mMatrix.isIdentity()) { if (mMatrix.isIdentity()) {
OP_LOGS("SetMatrix (reset)"); OP_LOGS("SetMatrix (reset)");
} else { } else {
@@ -501,11 +501,11 @@ public:
ConcatMatrixOp(const SkMatrix& matrix) ConcatMatrixOp(const SkMatrix& matrix)
: mMatrix(matrix) {} : mMatrix(matrix) {}
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.concatMatrix(mMatrix); renderer.concatMatrix(mMatrix);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("ConcatMatrix " SK_MATRIX_STRING, SK_MATRIX_ARGS(&mMatrix)); OP_LOG("ConcatMatrix " SK_MATRIX_STRING, SK_MATRIX_ARGS(&mMatrix));
} }
@@ -519,8 +519,8 @@ class ClipOp : public StateOp {
public: public:
ClipOp(SkRegion::Op op) : mOp(op) {} ClipOp(SkRegion::Op op) : mOp(op) {}
virtual void defer(DeferStateStruct& deferStruct, int saveCount, int /* level */, virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
bool /* useQuickReject */) { bool useQuickReject) {
// NOTE: must defer op BEFORE applying state, since it may read clip // NOTE: must defer op BEFORE applying state, since it may read clip
deferStruct.mDeferredList.addClip(deferStruct.mRenderer, this); deferStruct.mDeferredList.addClip(deferStruct.mRenderer, this);
@@ -543,11 +543,11 @@ public:
ClipRectOp(float left, float top, float right, float bottom, SkRegion::Op op) ClipRectOp(float left, float top, float right, float bottom, SkRegion::Op op)
: ClipOp(op), mArea(left, top, right, bottom) {} : ClipOp(op), mArea(left, top, right, bottom) {}
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.clipRect(mArea.left, mArea.top, mArea.right, mArea.bottom, mOp); renderer.clipRect(mArea.left, mArea.top, mArea.right, mArea.bottom, mOp);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("ClipRect " RECT_STRING, RECT_ARGS(mArea)); OP_LOG("ClipRect " RECT_STRING, RECT_ARGS(mArea));
} }
@@ -565,11 +565,11 @@ public:
ClipPathOp(const SkPath* path, SkRegion::Op op) ClipPathOp(const SkPath* path, SkRegion::Op op)
: ClipOp(op), mPath(path) {} : ClipOp(op), mPath(path) {}
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.clipPath(mPath, mOp); renderer.clipPath(mPath, mOp);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
SkRect bounds = mPath->getBounds(); SkRect bounds = mPath->getBounds();
OP_LOG("ClipPath bounds " RECT_STRING, OP_LOG("ClipPath bounds " RECT_STRING,
bounds.left(), bounds.top(), bounds.right(), bounds.bottom()); bounds.left(), bounds.top(), bounds.right(), bounds.bottom());
@@ -586,11 +586,11 @@ public:
ClipRegionOp(const SkRegion* region, SkRegion::Op op) ClipRegionOp(const SkRegion* region, SkRegion::Op op)
: ClipOp(op), mRegion(region) {} : ClipOp(op), mRegion(region) {}
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.clipRegion(mRegion, mOp); renderer.clipRegion(mRegion, mOp);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
SkIRect bounds = mRegion->getBounds(); SkIRect bounds = mRegion->getBounds();
OP_LOG("ClipRegion bounds %d %d %d %d", OP_LOG("ClipRegion bounds %d %d %d %d",
bounds.left(), bounds.top(), bounds.right(), bounds.bottom()); bounds.left(), bounds.top(), bounds.right(), bounds.bottom());
@@ -604,11 +604,11 @@ private:
class ResetPaintFilterOp : public StateOp { class ResetPaintFilterOp : public StateOp {
public: public:
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.resetPaintFilter(); renderer.resetPaintFilter();
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOGS("ResetPaintFilter"); OP_LOGS("ResetPaintFilter");
} }
@@ -620,11 +620,11 @@ public:
SetupPaintFilterOp(int clearBits, int setBits) SetupPaintFilterOp(int clearBits, int setBits)
: mClearBits(clearBits), mSetBits(setBits) {} : mClearBits(clearBits), mSetBits(setBits) {}
virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const { virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
renderer.setupPaintFilter(mClearBits, mSetBits); renderer.setupPaintFilter(mClearBits, mSetBits);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("SetupPaintFilter, clear %#x, set %#x", mClearBits, mSetBits); OP_LOG("SetupPaintFilter, clear %#x, set %#x", mClearBits, mSetBits);
} }
@@ -652,7 +652,7 @@ public:
} }
} }
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawBitmap(mBitmap, getPaint(renderer)); return renderer.drawBitmap(mBitmap, getPaint(renderer));
} }
@@ -675,7 +675,7 @@ public:
* for each bitmap in the batch. This method is also responsible for dirtying * for each bitmap in the batch. This method is also responsible for dirtying
* the current layer, if any. * the current layer, if any.
*/ */
virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& /* dirty */, virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& dirty,
const Vector<OpStatePair>& ops, const Rect& bounds) { const Vector<OpStatePair>& ops, const Rect& bounds) {
const DeferredDisplayState& firstState = *(ops[0].state); const DeferredDisplayState& firstState = *(ops[0].state);
renderer.restoreDisplayState(firstState, true); // restore all but the clip renderer.restoreDisplayState(firstState, true); // restore all but the clip
@@ -716,13 +716,13 @@ public:
pureTranslate, bounds, mPaint); pureTranslate, bounds, mPaint);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw bitmap %p at %f %f", mBitmap, mLocalBounds.left, mLocalBounds.top); OP_LOG("Draw bitmap %p at %f %f", mBitmap, mLocalBounds.left, mLocalBounds.top);
} }
virtual const char* name() { return "DrawBitmap"; } virtual const char* name() { return "DrawBitmap"; }
virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& state) { const DeferredDisplayState& state) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap; deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap;
deferInfo.mergeId = getAtlasEntry() ? deferInfo.mergeId = getAtlasEntry() ?
@@ -755,21 +755,21 @@ public:
: DrawBoundedOp(dstLeft, dstTop, dstRight, dstBottom, paint), : DrawBoundedOp(dstLeft, dstTop, dstRight, dstBottom, paint),
mBitmap(bitmap), mSrc(srcLeft, srcTop, srcRight, srcBottom) {} mBitmap(bitmap), mSrc(srcLeft, srcTop, srcRight, srcBottom) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawBitmap(mBitmap, mSrc.left, mSrc.top, mSrc.right, mSrc.bottom, return renderer.drawBitmap(mBitmap, mSrc.left, mSrc.top, mSrc.right, mSrc.bottom,
mLocalBounds.left, mLocalBounds.top, mLocalBounds.right, mLocalBounds.bottom, mLocalBounds.left, mLocalBounds.top, mLocalBounds.right, mLocalBounds.bottom,
getPaint(renderer)); getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw bitmap %p src=" RECT_STRING ", dst=" RECT_STRING, OP_LOG("Draw bitmap %p src=" RECT_STRING ", dst=" RECT_STRING,
mBitmap, RECT_ARGS(mSrc), RECT_ARGS(mLocalBounds)); mBitmap, RECT_ARGS(mSrc), RECT_ARGS(mLocalBounds));
} }
virtual const char* name() { return "DrawBitmapRect"; } virtual const char* name() { return "DrawBitmapRect"; }
virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& /* state */) { const DeferredDisplayState& state) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap; deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap;
} }
@@ -783,18 +783,18 @@ public:
DrawBitmapDataOp(const SkBitmap* bitmap, const SkPaint* paint) DrawBitmapDataOp(const SkBitmap* bitmap, const SkPaint* paint)
: DrawBitmapOp(bitmap, paint) {} : DrawBitmapOp(bitmap, paint) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawBitmapData(mBitmap, getPaint(renderer)); return renderer.drawBitmapData(mBitmap, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw bitmap %p", mBitmap); OP_LOG("Draw bitmap %p", mBitmap);
} }
virtual const char* name() { return "DrawBitmapData"; } virtual const char* name() { return "DrawBitmapData"; }
virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& /* state */) { const DeferredDisplayState& state) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap; deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap;
} }
}; };
@@ -807,19 +807,19 @@ public:
mBitmap(bitmap), mMeshWidth(meshWidth), mMeshHeight(meshHeight), mBitmap(bitmap), mMeshWidth(meshWidth), mMeshHeight(meshHeight),
mVertices(vertices), mColors(colors) {} mVertices(vertices), mColors(colors) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawBitmapMesh(mBitmap, mMeshWidth, mMeshHeight, return renderer.drawBitmapMesh(mBitmap, mMeshWidth, mMeshHeight,
mVertices, mColors, getPaint(renderer)); mVertices, mColors, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw bitmap %p mesh %d x %d", mBitmap, mMeshWidth, mMeshHeight); OP_LOG("Draw bitmap %p mesh %d x %d", mBitmap, mMeshWidth, mMeshHeight);
} }
virtual const char* name() { return "DrawBitmapMesh"; } virtual const char* name() { return "DrawBitmapMesh"; }
virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& /* state */) { const DeferredDisplayState& state) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap; deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap;
} }
@@ -868,8 +868,8 @@ public:
* and transforming the vertices of each 9-patch in the batch. This method * and transforming the vertices of each 9-patch in the batch. This method
* is also responsible for dirtying the current layer, if any. * is also responsible for dirtying the current layer, if any.
*/ */
virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& /* dirty */, virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& dirty,
const Vector<OpStatePair>& ops, const Rect& /* bounds */) { const Vector<OpStatePair>& ops, const Rect& bounds) {
const DeferredDisplayState& firstState = *(ops[0].state); const DeferredDisplayState& firstState = *(ops[0].state);
renderer.restoreDisplayState(firstState, true); // restore all but the clip renderer.restoreDisplayState(firstState, true); // restore all but the clip
@@ -942,7 +942,7 @@ public:
&vertices[0], indexCount, getPaint(renderer)); &vertices[0], indexCount, getPaint(renderer));
} }
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
// We're not calling the public variant of drawPatch() here // We're not calling the public variant of drawPatch() here
// This method won't perform the quickReject() since we've already done it at this point // This method won't perform the quickReject() since we've already done it at this point
return renderer.drawPatch(mBitmap, getMesh(renderer), getAtlasEntry(), return renderer.drawPatch(mBitmap, getMesh(renderer), getAtlasEntry(),
@@ -950,13 +950,13 @@ public:
getPaint(renderer)); getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw patch " RECT_STRING, RECT_ARGS(mLocalBounds)); OP_LOG("Draw patch " RECT_STRING, RECT_ARGS(mLocalBounds));
} }
virtual const char* name() { return "DrawPatch"; } virtual const char* name() { return "DrawPatch"; }
virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& state) { const DeferredDisplayState& state) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Patch; deferInfo.batchId = DeferredDisplayList::kOpBatch_Patch;
deferInfo.mergeId = getAtlasEntry() ? (mergeid_t) mEntry->getMergeId() : (mergeid_t) mBitmap; deferInfo.mergeId = getAtlasEntry() ? (mergeid_t) mEntry->getMergeId() : (mergeid_t) mBitmap;
@@ -982,11 +982,11 @@ public:
DrawColorOp(int color, SkXfermode::Mode mode) DrawColorOp(int color, SkXfermode::Mode mode)
: DrawOp(NULL), mColor(color), mMode(mode) {}; : DrawOp(NULL), mColor(color), mMode(mode) {};
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawColor(mColor, mMode); return renderer.drawColor(mColor, mMode);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw color %#x, mode %d", mColor, mMode); OP_LOG("Draw color %#x, mode %d", mColor, mMode);
} }
@@ -1012,8 +1012,8 @@ public:
return true; return true;
} }
virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& /* state */) { const DeferredDisplayState& state) {
if (mPaint->getPathEffect()) { if (mPaint->getPathEffect()) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_AlphaMaskTexture; deferInfo.batchId = DeferredDisplayList::kOpBatch_AlphaMaskTexture;
} else { } else {
@@ -1029,12 +1029,12 @@ public:
DrawRectOp(float left, float top, float right, float bottom, const SkPaint* paint) DrawRectOp(float left, float top, float right, float bottom, const SkPaint* paint)
: DrawStrokableOp(left, top, right, bottom, paint) {} : DrawStrokableOp(left, top, right, bottom, paint) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawRect(mLocalBounds.left, mLocalBounds.top, return renderer.drawRect(mLocalBounds.left, mLocalBounds.top,
mLocalBounds.right, mLocalBounds.bottom, getPaint(renderer)); mLocalBounds.right, mLocalBounds.bottom, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Rect " RECT_STRING, RECT_ARGS(mLocalBounds)); OP_LOG("Draw Rect " RECT_STRING, RECT_ARGS(mLocalBounds));
} }
@@ -1054,18 +1054,18 @@ public:
: DrawBoundedOp(rects, count, paint), : DrawBoundedOp(rects, count, paint),
mRects(rects), mCount(count) {} mRects(rects), mCount(count) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawRects(mRects, mCount, getPaint(renderer)); return renderer.drawRects(mRects, mCount, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Rects count %d", mCount); OP_LOG("Draw Rects count %d", mCount);
} }
virtual const char* name() { return "DrawRects"; } virtual const char* name() { return "DrawRects"; }
virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& /* state */) { const DeferredDisplayState& state) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Vertices; deferInfo.batchId = DeferredDisplayList::kOpBatch_Vertices;
} }
@@ -1080,12 +1080,12 @@ public:
float rx, float ry, const SkPaint* paint) float rx, float ry, const SkPaint* paint)
: DrawStrokableOp(left, top, right, bottom, paint), mRx(rx), mRy(ry) {} : DrawStrokableOp(left, top, right, bottom, paint), mRx(rx), mRy(ry) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawRoundRect(mLocalBounds.left, mLocalBounds.top, return renderer.drawRoundRect(mLocalBounds.left, mLocalBounds.top,
mLocalBounds.right, mLocalBounds.bottom, mRx, mRy, getPaint(renderer)); mLocalBounds.right, mLocalBounds.bottom, mRx, mRy, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw RoundRect " RECT_STRING ", rx %f, ry %f", RECT_ARGS(mLocalBounds), mRx, mRy); OP_LOG("Draw RoundRect " RECT_STRING ", rx %f, ry %f", RECT_ARGS(mLocalBounds), mRx, mRy);
} }
@@ -1112,12 +1112,12 @@ public:
: DrawOp(paint), mLeft(left), mTop(top), mRight(right), mBottom(bottom), : DrawOp(paint), mLeft(left), mTop(top), mRight(right), mBottom(bottom),
mRx(rx), mRy(ry) {} mRx(rx), mRy(ry) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawRoundRect(*mLeft, *mTop, *mRight, *mBottom, return renderer.drawRoundRect(*mLeft, *mTop, *mRight, *mBottom,
*mRx, *mRy, getPaint(renderer)); *mRx, *mRy, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw RoundRect Props " RECT_STRING ", rx %f, ry %f", OP_LOG("Draw RoundRect Props " RECT_STRING ", rx %f, ry %f",
*mLeft, *mTop, *mRight, *mBottom, *mRx, *mRy); *mLeft, *mTop, *mRight, *mBottom, *mRx, *mRy);
} }
@@ -1139,11 +1139,11 @@ public:
: DrawStrokableOp(x - radius, y - radius, x + radius, y + radius, paint), : DrawStrokableOp(x - radius, y - radius, x + radius, y + radius, paint),
mX(x), mY(y), mRadius(radius) {} mX(x), mY(y), mRadius(radius) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawCircle(mX, mY, mRadius, getPaint(renderer)); return renderer.drawCircle(mX, mY, mRadius, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Circle x %f, y %f, r %f", mX, mY, mRadius); OP_LOG("Draw Circle x %f, y %f, r %f", mX, mY, mRadius);
} }
@@ -1160,11 +1160,11 @@ public:
DrawCirclePropsOp(float* x, float* y, float* radius, const SkPaint* paint) DrawCirclePropsOp(float* x, float* y, float* radius, const SkPaint* paint)
: DrawOp(paint), mX(x), mY(y), mRadius(radius) {} : DrawOp(paint), mX(x), mY(y), mRadius(radius) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawCircle(*mX, *mY, *mRadius, getPaint(renderer)); return renderer.drawCircle(*mX, *mY, *mRadius, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Circle Props x %p, y %p, r %p", mX, mY, mRadius); OP_LOG("Draw Circle Props x %p, y %p, r %p", mX, mY, mRadius);
} }
@@ -1181,12 +1181,12 @@ public:
DrawOvalOp(float left, float top, float right, float bottom, const SkPaint* paint) DrawOvalOp(float left, float top, float right, float bottom, const SkPaint* paint)
: DrawStrokableOp(left, top, right, bottom, paint) {} : DrawStrokableOp(left, top, right, bottom, paint) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawOval(mLocalBounds.left, mLocalBounds.top, return renderer.drawOval(mLocalBounds.left, mLocalBounds.top,
mLocalBounds.right, mLocalBounds.bottom, getPaint(renderer)); mLocalBounds.right, mLocalBounds.bottom, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Oval " RECT_STRING, RECT_ARGS(mLocalBounds)); OP_LOG("Draw Oval " RECT_STRING, RECT_ARGS(mLocalBounds));
} }
@@ -1200,13 +1200,13 @@ public:
: DrawStrokableOp(left, top, right, bottom, paint), : DrawStrokableOp(left, top, right, bottom, paint),
mStartAngle(startAngle), mSweepAngle(sweepAngle), mUseCenter(useCenter) {} mStartAngle(startAngle), mSweepAngle(sweepAngle), mUseCenter(useCenter) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawArc(mLocalBounds.left, mLocalBounds.top, return renderer.drawArc(mLocalBounds.left, mLocalBounds.top,
mLocalBounds.right, mLocalBounds.bottom, mLocalBounds.right, mLocalBounds.bottom,
mStartAngle, mSweepAngle, mUseCenter, getPaint(renderer)); mStartAngle, mSweepAngle, mUseCenter, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Arc " RECT_STRING ", start %f, sweep %f, useCenter %d", OP_LOG("Draw Arc " RECT_STRING ", start %f, sweep %f, useCenter %d",
RECT_ARGS(mLocalBounds), mStartAngle, mSweepAngle, mUseCenter); RECT_ARGS(mLocalBounds), mStartAngle, mSweepAngle, mUseCenter);
} }
@@ -1231,19 +1231,19 @@ public:
mLocalBounds.set(left, top, left + width, top + height); mLocalBounds.set(left, top, left + width, top + height);
} }
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawPath(mPath, getPaint(renderer)); return renderer.drawPath(mPath, getPaint(renderer));
} }
virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& /* state */) { const DeferredDisplayState& state) {
const SkPaint* paint = getPaint(renderer); const SkPaint* paint = getPaint(renderer);
renderer.getCaches().pathCache.precache(mPath, paint); renderer.getCaches().pathCache.precache(mPath, paint);
deferInfo.batchId = DeferredDisplayList::kOpBatch_AlphaMaskTexture; deferInfo.batchId = DeferredDisplayList::kOpBatch_AlphaMaskTexture;
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Path %p in " RECT_STRING, mPath, RECT_ARGS(mLocalBounds)); OP_LOG("Draw Path %p in " RECT_STRING, mPath, RECT_ARGS(mLocalBounds));
} }
@@ -1261,18 +1261,18 @@ public:
mLocalBounds.outset(strokeWidthOutset()); mLocalBounds.outset(strokeWidthOutset());
} }
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawLines(mPoints, mCount, getPaint(renderer)); return renderer.drawLines(mPoints, mCount, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Lines count %d", mCount); OP_LOG("Draw Lines count %d", mCount);
} }
virtual const char* name() { return "DrawLines"; } virtual const char* name() { return "DrawLines"; }
virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& /* state */) { const DeferredDisplayState& state) {
deferInfo.batchId = mPaint->isAntiAlias() ? deferInfo.batchId = mPaint->isAntiAlias() ?
DeferredDisplayList::kOpBatch_AlphaVertices : DeferredDisplayList::kOpBatch_AlphaVertices :
DeferredDisplayList::kOpBatch_Vertices; DeferredDisplayList::kOpBatch_Vertices;
@@ -1288,11 +1288,11 @@ public:
DrawPointsOp(const float* points, int count, const SkPaint* paint) DrawPointsOp(const float* points, int count, const SkPaint* paint)
: DrawLinesOp(points, count, paint) {} : DrawLinesOp(points, count, paint) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawPoints(mPoints, mCount, getPaint(renderer)); return renderer.drawPoints(mPoints, mCount, getPaint(renderer));
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Points count %d", mCount); OP_LOG("Draw Points count %d", mCount);
} }
@@ -1304,7 +1304,7 @@ public:
DrawSomeTextOp(const char* text, int bytesCount, int count, const SkPaint* paint) DrawSomeTextOp(const char* text, int bytesCount, int count, const SkPaint* paint)
: DrawOp(paint), mText(text), mBytesCount(bytesCount), mCount(count) {}; : DrawOp(paint), mText(text), mBytesCount(bytesCount), mCount(count) {};
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw some text, %d bytes", mBytesCount); OP_LOG("Draw some text, %d bytes", mBytesCount);
} }
@@ -1313,7 +1313,7 @@ public:
} }
virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& /* state */) { const DeferredDisplayState& state) {
const SkPaint* paint = getPaint(renderer); const SkPaint* paint = getPaint(renderer);
FontRenderer& fontRenderer = renderer.getCaches().fontRenderer->getFontRenderer(paint); FontRenderer& fontRenderer = renderer.getCaches().fontRenderer->getFontRenderer(paint);
fontRenderer.precache(paint, mText, mCount, SkMatrix::I()); fontRenderer.precache(paint, mText, mCount, SkMatrix::I());
@@ -1338,7 +1338,7 @@ public:
/* TODO: inherit from DrawBounded and init mLocalBounds */ /* TODO: inherit from DrawBounded and init mLocalBounds */
} }
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawTextOnPath(mText, mBytesCount, mCount, mPath, return renderer.drawTextOnPath(mText, mBytesCount, mCount, mPath,
mHOffset, mVOffset, getPaint(renderer)); mHOffset, mVOffset, getPaint(renderer));
} }
@@ -1359,7 +1359,7 @@ public:
/* TODO: inherit from DrawBounded and init mLocalBounds */ /* TODO: inherit from DrawBounded and init mLocalBounds */
} }
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawPosText(mText, mBytesCount, mCount, mPositions, getPaint(renderer)); return renderer.drawPosText(mText, mBytesCount, mCount, mPositions, getPaint(renderer));
} }
@@ -1403,15 +1403,15 @@ public:
&& OpenGLRenderer::getXfermodeDirect(mPaint) == SkXfermode::kSrcOver_Mode; && OpenGLRenderer::getXfermodeDirect(mPaint) == SkXfermode::kSrcOver_Mode;
} }
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
Rect bounds; Rect bounds;
getLocalBounds(bounds); getLocalBounds(bounds);
return renderer.drawText(mText, mBytesCount, mCount, mX, mY, return renderer.drawText(mText, mBytesCount, mCount, mX, mY,
mPositions, getPaint(renderer), mTotalAdvance, bounds); mPositions, getPaint(renderer), mTotalAdvance, bounds);
} }
virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& /* dirty */, virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& dirty,
const Vector<OpStatePair>& ops, const Rect& /* bounds */) { const Vector<OpStatePair>& ops, const Rect& bounds) {
status_t status = DrawGlInfo::kStatusDone; status_t status = DrawGlInfo::kStatusDone;
for (unsigned int i = 0; i < ops.size(); i++) { for (unsigned int i = 0; i < ops.size(); i++) {
const DeferredDisplayState& state = *(ops[i].state); const DeferredDisplayState& state = *(ops[i].state);
@@ -1428,7 +1428,7 @@ public:
return status; return status;
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Text of count %d, bytes %d", mCount, mBytesCount); OP_LOG("Draw Text of count %d, bytes %d", mCount, mBytesCount);
} }
@@ -1461,7 +1461,7 @@ public:
return ret; return ret;
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Functor %p", mFunctor); OP_LOG("Draw Functor %p", mFunctor);
} }
@@ -1479,21 +1479,21 @@ public:
: DrawBoundedOp(0, 0, renderNode->getWidth(), renderNode->getHeight(), 0), : DrawBoundedOp(0, 0, renderNode->getWidth(), renderNode->getHeight(), 0),
mRenderNode(renderNode), mFlags(flags), mTransformFromParent(transformFromParent) {} mRenderNode(renderNode), mFlags(flags), mTransformFromParent(transformFromParent) {}
virtual void defer(DeferStateStruct& deferStruct, int /* saveCount */, int level, virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
bool /* useQuickReject */) { bool useQuickReject) {
if (mRenderNode->isRenderable() && !mSkipInOrderDraw) { if (mRenderNode->isRenderable() && !mSkipInOrderDraw) {
mRenderNode->defer(deferStruct, level + 1); mRenderNode->defer(deferStruct, level + 1);
} }
} }
virtual void replay(ReplayStateStruct& replayStruct, int /* saveCount */, int level, virtual void replay(ReplayStateStruct& replayStruct, int saveCount, int level,
bool /* useQuickReject */) { bool useQuickReject) {
if (mRenderNode->isRenderable() && !mSkipInOrderDraw) { if (mRenderNode->isRenderable() && !mSkipInOrderDraw) {
mRenderNode->replay(replayStruct, level + 1); mRenderNode->replay(replayStruct, level + 1);
} }
} }
virtual status_t applyDraw(OpenGLRenderer& /* renderer */, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
LOG_ALWAYS_FATAL("should not be called, because replay() is overridden"); LOG_ALWAYS_FATAL("should not be called, because replay() is overridden");
return 0; return 0;
} }
@@ -1547,14 +1547,14 @@ public:
, mCasterOutline(casterOutline) { , mCasterOutline(casterOutline) {
} }
virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& /* deferInfo */, virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
const DeferredDisplayState& state) { const DeferredDisplayState& state) {
renderer.getCaches().tessellationCache.precacheShadows(&state.mMatrix, renderer.getCaches().tessellationCache.precacheShadows(&state.mMatrix,
renderer.getLocalClipBounds(), isCasterOpaque(), mCasterOutline, renderer.getLocalClipBounds(), isCasterOpaque(), mCasterOutline,
&mTransformXY, &mTransformZ, renderer.getLightCenter(), renderer.getLightRadius()); &mTransformXY, &mTransformZ, renderer.getLightCenter(), renderer.getLightRadius());
} }
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
TessellationCache::vertexBuffer_pair_t buffers; TessellationCache::vertexBuffer_pair_t buffers;
Matrix4 drawTransform(*(renderer.currentTransform())); Matrix4 drawTransform(*(renderer.currentTransform()));
renderer.getCaches().tessellationCache.getShadowBuffers(&drawTransform, renderer.getCaches().tessellationCache.getShadowBuffers(&drawTransform,
@@ -1565,7 +1565,7 @@ public:
return renderer.drawShadow(mCasterAlpha, buffers.first, buffers.second); return renderer.drawShadow(mCasterAlpha, buffers.first, buffers.second);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOGS("DrawShadow"); OP_LOGS("DrawShadow");
} }
@@ -1585,11 +1585,11 @@ public:
DrawLayerOp(Layer* layer, float x, float y) DrawLayerOp(Layer* layer, float x, float y)
: DrawOp(NULL), mLayer(layer), mX(x), mY(y) {} : DrawOp(NULL), mLayer(layer), mX(x), mY(y) {}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) { virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
return renderer.drawLayer(mLayer, mX, mY); return renderer.drawLayer(mLayer, mX, mY);
} }
virtual void output(int level, uint32_t /* logFlags */) const { virtual void output(int level, uint32_t logFlags) const {
OP_LOG("Draw Layer %p at %f %f", mLayer, mX, mY); OP_LOG("Draw Layer %p at %f %f", mLayer, mX, mY);
} }

View File

@@ -59,8 +59,8 @@ DisplayListData* DisplayListRenderer::finishRecording() {
return data; return data;
} }
status_t DisplayListRenderer::prepareDirty(float /* left */, float /* top */, status_t DisplayListRenderer::prepareDirty(float left, float top,
float /* right */, float /* bottom */, bool opaque) { float right, float bottom, bool opaque) {
LOG_ALWAYS_FATAL_IF(mDisplayListData, LOG_ALWAYS_FATAL_IF(mDisplayListData,
"prepareDirty called a second time during a recording!"); "prepareDirty called a second time during a recording!");
@@ -86,7 +86,7 @@ void DisplayListRenderer::interrupt() {
void DisplayListRenderer::resume() { void DisplayListRenderer::resume() {
} }
status_t DisplayListRenderer::callDrawGLFunction(Functor *functor, Rect& /* dirty */) { status_t DisplayListRenderer::callDrawGLFunction(Functor *functor, Rect& dirty) {
// Ignore dirty during recording, it matters only when we replay // Ignore dirty during recording, it matters only when we replay
addDrawOp(new (alloc()) DrawFunctorOp(functor)); addDrawOp(new (alloc()) DrawFunctorOp(functor));
mDisplayListData->functors.add(functor); mDisplayListData->functors.add(functor);
@@ -177,8 +177,7 @@ bool DisplayListRenderer::clipRegion(const SkRegion* region, SkRegion::Op op) {
return StatefulBaseRenderer::clipRegion(region, op); return StatefulBaseRenderer::clipRegion(region, op);
} }
status_t DisplayListRenderer::drawRenderNode(RenderNode* renderNode, Rect& /* dirty */, status_t DisplayListRenderer::drawRenderNode(RenderNode* renderNode, Rect& dirty, int32_t flags) {
int32_t flags) {
LOG_ALWAYS_FATAL_IF(!renderNode, "missing rendernode"); LOG_ALWAYS_FATAL_IF(!renderNode, "missing rendernode");
// dirty is an out parameter and should not be recorded, // dirty is an out parameter and should not be recorded,
@@ -392,7 +391,7 @@ static void simplifyPaint(int color, SkPaint* paint) {
status_t DisplayListRenderer::drawText(const char* text, int bytesCount, int count, status_t DisplayListRenderer::drawText(const char* text, int bytesCount, int count,
float x, float y, const float* positions, const SkPaint* paint, float x, float y, const float* positions, const SkPaint* paint,
float totalAdvance, const Rect& bounds, DrawOpMode /* drawOpMode */) { float totalAdvance, const Rect& bounds, DrawOpMode drawOpMode) {
if (!text || count <= 0 || paintWillNotDrawText(*paint)) return DrawGlInfo::kStatusDone; if (!text || count <= 0 || paintWillNotDrawText(*paint)) return DrawGlInfo::kStatusDone;

View File

@@ -47,7 +47,7 @@ namespace uirenderer {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// TextSetupFunctor // TextSetupFunctor
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
status_t TextSetupFunctor::operator ()(int /* what */, void* data) { status_t TextSetupFunctor::operator ()(int what, void* data) {
Data* typedData = reinterpret_cast<Data*>(data); Data* typedData = reinterpret_cast<Data*>(data);
GLenum glyphFormat = typedData ? typedData->glyphFormat : GL_ALPHA; GLenum glyphFormat = typedData ? typedData->glyphFormat : GL_ALPHA;

View File

@@ -70,7 +70,7 @@ public:
} }
} }
FontRenderer& getFontRenderer(const SkPaint* /* paint */) { FontRenderer& getFontRenderer(const SkPaint* paint) {
if (!mRenderer) { if (!mRenderer) {
mRenderer = new FontRenderer; mRenderer = new FontRenderer;
} }
@@ -81,7 +81,7 @@ public:
return 1; return 1;
} }
uint32_t getFontRendererSize(uint32_t /* fontRenderer */, GLenum format) const { uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const {
return mRenderer ? mRenderer->getCacheSize(format) : 0; return mRenderer ? mRenderer->getCacheSize(format) : 0;
} }
@@ -116,7 +116,7 @@ public:
} }
} }
FontRenderer& getFontRenderer(const SkPaint* /* paint */) { FontRenderer& getFontRenderer(const SkPaint* paint) {
if (!mRenderer) { if (!mRenderer) {
mRenderer = new FontRenderer; mRenderer = new FontRenderer;
mRenderer->setGammaTable(&mGammaTable[0]); mRenderer->setGammaTable(&mGammaTable[0]);
@@ -128,14 +128,14 @@ public:
return 1; return 1;
} }
uint32_t getFontRendererSize(uint32_t /* fontRenderer */, GLenum format) const { uint32_t getFontRendererSize(uint32_t fontRenderer, GLenum format) const {
return mRenderer ? mRenderer->getCacheSize(format) : 0; return mRenderer ? mRenderer->getCacheSize(format) : 0;
} }
void describe(ProgramDescription& /* description */, const SkPaint* /* paint */) const { void describe(ProgramDescription& description, const SkPaint* paint) const {
} }
void setupProgram(ProgramDescription& /* description */, Program* /* program */) const { void setupProgram(ProgramDescription& description, Program* program) const {
} }
void endPrecaching(); void endPrecaching();
@@ -171,10 +171,10 @@ public:
return renderer->getCacheSize(format); return renderer->getCacheSize(format);
} }
void describe(ProgramDescription& /* description */, const SkPaint* /* paint */) const { void describe(ProgramDescription& description, const SkPaint* paint) const {
} }
void setupProgram(ProgramDescription& /* description */, Program* /* program */) const { void setupProgram(ProgramDescription& description, Program* program) const {
} }
void endPrecaching(); void endPrecaching();

View File

@@ -348,7 +348,7 @@ void OpenGLRenderer::resumeAfterLayer() {
dirtyClip(); dirtyClip();
} }
status_t OpenGLRenderer::callDrawGLFunction(Functor* functor, Rect& /* dirty */) { status_t OpenGLRenderer::callDrawGLFunction(Functor* functor, Rect& dirty) {
if (currentSnapshot()->isIgnored()) return DrawGlInfo::kStatusDone; if (currentSnapshot()->isIgnored()) return DrawGlInfo::kStatusDone;
Rect clip(*currentClipRect()); Rect clip(*currentClipRect());
@@ -401,8 +401,6 @@ void OpenGLRenderer::eventMarkDEBUG(const char* fmt, ...) const {
va_end(ap); va_end(ap);
eventMark(buf); eventMark(buf);
#else
(void)fmt;
#endif #endif
} }
@@ -1089,7 +1087,7 @@ public:
} }
protected: protected:
virtual void shadeSpan(int /* x */, int /* y */, SkPMColor[], int /* count */) { virtual void shadeSpan(int x, int y, SkPMColor[], int count) {
LOG_ALWAYS_FATAL("LayerShader should never be drawn with raster backend."); LOG_ALWAYS_FATAL("LayerShader should never be drawn with raster backend.");
} }

View File

@@ -196,7 +196,7 @@ void PathCache::setMaxSize(uint32_t maxSize) {
// Callbacks // Callbacks
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void PathCache::operator()(PathDescription& /* entry */, PathTexture*& texture) { void PathCache::operator()(PathDescription& entry, PathTexture*& texture) {
removeTexture(texture); removeTexture(texture);
} }

View File

@@ -285,8 +285,6 @@ struct ProgramDescription {
programid k = key(); programid k = key();
PROGRAM_LOGD("%s (key = 0x%.8x%.8x)", message, uint32_t(k >> 32), PROGRAM_LOGD("%s (key = 0x%.8x%.8x)", message, uint32_t(k >> 32),
uint32_t(k & 0xffffffff)); uint32_t(k & 0xffffffff));
#else
(void)message;
#endif #endif
} }

View File

@@ -455,7 +455,7 @@ Program* ProgramCache::get(const ProgramDescription& description) {
// Program generation // Program generation
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
Program* ProgramCache::generateProgram(const ProgramDescription& description, programid /* key */) { Program* ProgramCache::generateProgram(const ProgramDescription& description, programid key) {
String8 vertexShader = generateVertexShader(description); String8 vertexShader = generateVertexShader(description);
String8 fragmentShader = generateFragmentShader(description); String8 fragmentShader = generateFragmentShader(description);

View File

@@ -274,7 +274,7 @@ void RenderNode::pushStagingPropertiesChanges(TreeInfo& info) {
} }
} }
void RenderNode::applyLayerPropertiesToLayer(TreeInfo& /* info */) { void RenderNode::applyLayerPropertiesToLayer(TreeInfo& info) {
if (CC_LIKELY(!mLayer)) return; if (CC_LIKELY(!mLayer)) return;
const LayerProperties& props = properties().layerProperties(); const LayerProperties& props = properties().layerProperties();
@@ -567,7 +567,7 @@ public:
operation->defer(mDeferStruct, saveCount, mLevel, clipToBounds); operation->defer(mDeferStruct, saveCount, mLevel, clipToBounds);
} }
inline LinearAllocator& allocator() { return *(mDeferStruct.mAllocator); } inline LinearAllocator& allocator() { return *(mDeferStruct.mAllocator); }
inline void startMark(const char* /* name */) {} // do nothing inline void startMark(const char* name) {} // do nothing
inline void endMark() {} inline void endMark() {}
inline int level() { return mLevel; } inline int level() { return mLevel; }
inline int replayFlags() { return mDeferStruct.mReplayFlags; } inline int replayFlags() { return mDeferStruct.mReplayFlags; }

View File

@@ -52,13 +52,13 @@ public:
void debugOverdraw(bool enable, bool clear); void debugOverdraw(bool enable, bool clear);
void registerLayer(const Layer* /* layer */) { void registerLayer(const Layer* layer) {
/* /*
AutoMutex _lock(mLayerLock); AutoMutex _lock(mLayerLock);
mActiveLayers.insert(layer); mActiveLayers.insert(layer);
*/ */
} }
void unregisterLayer(const Layer* /* layer */) { void unregisterLayer(const Layer* layer) {
/* /*
AutoMutex _lock(mLayerLock); AutoMutex _lock(mLayerLock);
mActiveLayers.erase(layer); mActiveLayers.erase(layer);

View File

@@ -163,7 +163,7 @@ void SkiaShader::setupProgram(Caches* caches, const mat4& modelViewMatrix,
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void SkiaLayerShader::describe(Caches*, ProgramDescription& description, void SkiaLayerShader::describe(Caches*, ProgramDescription& description,
const Extensions&, const SkShader& /* shader */) { const Extensions&, const SkShader& shader) {
description.hasBitmap = true; description.hasBitmap = true;
} }
@@ -339,7 +339,7 @@ static bool isSimpleGradient(const SkShader::GradientInfo& gradInfo) {
} }
void SkiaGradientShader::describe(Caches*, ProgramDescription& description, void SkiaGradientShader::describe(Caches*, ProgramDescription& description,
const Extensions& /* extensions */, const SkShader& shader) { const Extensions& extensions, const SkShader& shader) {
SkShader::GradientInfo gradInfo; SkShader::GradientInfo gradInfo;
gradInfo.fColorCount = 0; gradInfo.fColorCount = 0;
gradInfo.fColors = NULL; gradInfo.fColors = NULL;

View File

@@ -57,13 +57,12 @@ public:
class InvalidSkiaShader { class InvalidSkiaShader {
public: public:
static void describe(Caches* /* caches */, ProgramDescription& /* description */, static void describe(Caches* caches, ProgramDescription& description,
const Extensions& /* extensions */, const SkShader& /* shader */) { const Extensions& extensions, const SkShader& shader) {
// This shader is unsupported. Skip it. // This shader is unsupported. Skip it.
} }
static void setupProgram(Caches* /* caches */, const mat4& /* modelViewMatrix */, static void setupProgram(Caches* caches, const mat4& modelViewMatrix,
GLuint* /* textureUnit */, const Extensions& /* extensions */, GLuint* textureUnit, const Extensions& extensions, const SkShader& shader) {
const SkShader& /* shader */) {
// This shader is unsupported. Skip it. // This shader is unsupported. Skip it.
} }

View File

@@ -912,8 +912,6 @@ int SpotShadow::setupAngleList(VertexAngleData* angleDataList,
angleDataList[i].set(currentAngle, isPenumbra, i); angleDataList[i].set(currentAngle, isPenumbra, i);
#if DEBUG_SHADOW #if DEBUG_SHADOW
ALOGD("%s AngleList i %d %f", name, i, currentAngle); ALOGD("%s AngleList i %d %f", name, i, currentAngle);
#else
(void)name;
#endif #endif
} }
return maxAngleIndex; return maxAngleIndex;
@@ -943,8 +941,6 @@ bool SpotShadow::checkClockwise(int indexOfMaxAngle, int listLength, VertexAngle
if (currentAngle < nextAngle) { if (currentAngle < nextAngle) {
#if DEBUG_SHADOW #if DEBUG_SHADOW
ALOGE("%s, is not CW, at index %d", name, currentIndex); ALOGE("%s, is not CW, at index %d", name, currentIndex);
#else
(void)name;
#endif #endif
return false; return false;
} }
@@ -1382,7 +1378,7 @@ int SpotShadow::convertPolysToVerticesPerRay(
/** /**
* Generate a triangle strip given two convex polygon * Generate a triangle strip given two convex polygon
**/ **/
void SpotShadow::generateTriangleStrip(bool isCasterOpaque, float /* shadowStrengthScale */, void SpotShadow::generateTriangleStrip(bool isCasterOpaque, float shadowStrengthScale,
Vector2* penumbra, int penumbraLength, Vector2* umbra, int umbraLength, Vector2* penumbra, int penumbraLength, Vector2* umbra, int umbraLength,
const Vector3* poly, int polyLength, VertexBuffer& shadowTriangleStrip, const Vector3* poly, int polyLength, VertexBuffer& shadowTriangleStrip,
const Vector2& centroid) { const Vector2& centroid) {

View File

@@ -129,8 +129,7 @@ protected:
* *
* Subclasses can override this method to handle layer restoration * Subclasses can override this method to handle layer restoration
*/ */
virtual void onSnapshotRestored(const Snapshot& /* removed */, virtual void onSnapshotRestored(const Snapshot& removed, const Snapshot& restored) {};
const Snapshot& /* restored */) {};
virtual void onViewportInitialized() {}; virtual void onViewportInitialized() {};

View File

@@ -365,7 +365,7 @@ void TessellationCache::clear() {
// Callbacks // Callbacks
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void TessellationCache::BufferRemovedListener::operator()(Description& /* description */, void TessellationCache::BufferRemovedListener::operator()(Description& description,
Buffer*& buffer) { Buffer*& buffer) {
delete buffer; delete buffer;
} }

View File

@@ -178,8 +178,7 @@ private:
// holds a pointer, and implicit strong ref to each shadow task of the frame // holds a pointer, and implicit strong ref to each shadow task of the frame
LruCache<ShadowDescription, Task<vertexBuffer_pair_t*>*> mShadowCache; LruCache<ShadowDescription, Task<vertexBuffer_pair_t*>*> mShadowCache;
class BufferPairRemovedListener : public OnEntryRemoved<ShadowDescription, Task<vertexBuffer_pair_t*>*> { class BufferPairRemovedListener : public OnEntryRemoved<ShadowDescription, Task<vertexBuffer_pair_t*>*> {
void operator()(ShadowDescription& /* description */, void operator()(ShadowDescription& description, Task<vertexBuffer_pair_t*>*& bufferPairTask) {
Task<vertexBuffer_pair_t*>*& bufferPairTask) {
bufferPairTask->decStrong(NULL); bufferPairTask->decStrong(NULL);
} }
}; };

View File

@@ -139,8 +139,7 @@ void Font::invalidateTextureCache(CacheTexture* cacheTexture) {
} }
void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y, void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y,
uint8_t* /* bitmap */, uint32_t /* bitmapW */, uint32_t /* bitmapH */, Rect* bounds, uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
const float* /* pos */) {
int width = (int) glyph->mBitmapWidth; int width = (int) glyph->mBitmapWidth;
int height = (int) glyph->mBitmapHeight; int height = (int) glyph->mBitmapHeight;
@@ -162,8 +161,7 @@ void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y,
} }
void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y, void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
uint8_t* /* bitmap */, uint32_t /* bitmapW */, uint32_t /* bitmapH */, Rect* /* bounds */, uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
const float* /* pos */) {
float width = (float) glyph->mBitmapWidth; float width = (float) glyph->mBitmapWidth;
float height = (float) glyph->mBitmapHeight; float height = (float) glyph->mBitmapHeight;
@@ -182,8 +180,7 @@ void Font::drawCachedGlyph(CachedGlyphInfo* glyph, int x, int y,
} }
void Font::drawCachedGlyphTransformed(CachedGlyphInfo* glyph, int x, int y, void Font::drawCachedGlyphTransformed(CachedGlyphInfo* glyph, int x, int y,
uint8_t* /* bitmap */, uint32_t /* bitmapW */, uint32_t /* bitmapH */, Rect* /* bounds */, uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
const float* /* pos */) {
float width = (float) glyph->mBitmapWidth; float width = (float) glyph->mBitmapWidth;
float height = (float) glyph->mBitmapHeight; float height = (float) glyph->mBitmapHeight;
@@ -213,8 +210,7 @@ void Font::drawCachedGlyphTransformed(CachedGlyphInfo* glyph, int x, int y,
} }
void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y, uint8_t* bitmap, void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y, uint8_t* bitmap,
uint32_t bitmapWidth, uint32_t /* bitmapHeight */, Rect* /* bounds */, uint32_t bitmapWidth, uint32_t bitmapHeight, Rect* bounds, const float* pos) {
const float* /* pos */) {
int dstX = x + glyph->mBitmapLeft; int dstX = x + glyph->mBitmapLeft;
int dstY = y + glyph->mBitmapTop; int dstY = y + glyph->mBitmapTop;
@@ -431,7 +427,7 @@ void Font::render(const SkPaint* paint, const char* text, uint32_t start, uint32
} }
} }
void Font::updateGlyphCache(const SkPaint* /* paint */, const SkGlyph& skiaGlyph, void Font::updateGlyphCache(const SkPaint* paint, const SkGlyph& skiaGlyph,
SkGlyphCache* skiaGlyphCache, CachedGlyphInfo* glyph, bool precaching) { SkGlyphCache* skiaGlyphCache, CachedGlyphInfo* glyph, bool precaching) {
glyph->mAdvanceX = skiaGlyph.fAdvanceX; glyph->mAdvanceX = skiaGlyph.fAdvanceX;
glyph->mAdvanceY = skiaGlyph.fAdvanceY; glyph->mAdvanceY = skiaGlyph.fAdvanceY;

View File

@@ -115,13 +115,13 @@ void CanvasContext::updateSurface(ANativeWindow* window) {
setSurface(window); setSurface(window);
} }
void CanvasContext::pauseSurface(ANativeWindow* /* window */) { void CanvasContext::pauseSurface(ANativeWindow* window) {
stopDrawing(); stopDrawing();
} }
// TODO: don't pass viewport size, it's automatic via EGL // TODO: don't pass viewport size, it's automatic via EGL
void CanvasContext::setup(int /* width */, int /* height */, const Vector3& lightCenter, void CanvasContext::setup(int width, int height, const Vector3& lightCenter, float lightRadius,
float lightRadius, uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha) { uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha) {
if (!mCanvas) return; if (!mCanvas) return;
mCanvas->initLight(lightCenter, lightRadius, ambientShadowAlpha, spotShadowAlpha); mCanvas->initLight(lightCenter, lightRadius, ambientShadowAlpha, spotShadowAlpha);
} }

View File

@@ -344,16 +344,14 @@ void RenderProxy::trimMemory(int level) {
} }
} }
template <typename T>
void UNUSED(T) {}
CREATE_BRIDGE0(fence) { CREATE_BRIDGE0(fence) {
// Intentionally empty // Intentionally empty
UNUSED(args);
return NULL; return NULL;
} }
template <typename T>
void UNUSED(T t) {}
void RenderProxy::fence() { void RenderProxy::fence() {
SETUP_TASK(fence); SETUP_TASK(fence);
UNUSED(args); UNUSED(args);

View File

@@ -171,7 +171,7 @@ void RenderThread::initThreadLocals() {
mRenderState = new RenderState(); mRenderState = new RenderState();
} }
int RenderThread::displayEventReceiverCallback(int /* fd */, int events, void* data) { int RenderThread::displayEventReceiverCallback(int fd, int events, void* data) {
if (events & (Looper::EVENT_ERROR | Looper::EVENT_HANGUP)) { if (events & (Looper::EVENT_ERROR | Looper::EVENT_HANGUP)) {
ALOGE("Display event receiver pipe was closed or an error occurred. " ALOGE("Display event receiver pipe was closed or an error occurred. "
"events=0x%x", events); "events=0x%x", events);