summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/AmbientShadow.cpp4
-rw-r--r--libs/hwui/Android.mk191
-rw-r--r--libs/hwui/AnimationContext.cpp2
-rw-r--r--libs/hwui/Animator.cpp8
-rw-r--r--libs/hwui/Caches.h10
-rw-r--r--libs/hwui/DeferredDisplayList.cpp16
-rw-r--r--libs/hwui/DeferredDisplayList.h2
-rw-r--r--libs/hwui/DisplayList.h3
-rw-r--r--libs/hwui/DisplayListLogBuffer.cpp2
-rw-r--r--libs/hwui/DisplayListOp.h230
-rw-r--r--libs/hwui/DisplayListRenderer.cpp11
-rw-r--r--libs/hwui/FontRenderer.cpp4
-rw-r--r--libs/hwui/GammaFontRenderer.h16
-rw-r--r--libs/hwui/Interpolator.cpp4
-rw-r--r--libs/hwui/Layer.h2
-rw-r--r--libs/hwui/LayerCache.cpp24
-rw-r--r--libs/hwui/LayerCache.h8
-rwxr-xr-xlibs/hwui/OpenGLRenderer.cpp29
-rw-r--r--libs/hwui/PathCache.cpp4
-rw-r--r--libs/hwui/PathTessellator.cpp8
-rw-r--r--libs/hwui/Program.h2
-rw-r--r--libs/hwui/ProgramCache.cpp2
-rw-r--r--libs/hwui/Properties.h2
-rw-r--r--libs/hwui/RenderNode.cpp10
-rw-r--r--libs/hwui/ShadowTessellator.cpp1
-rw-r--r--libs/hwui/SkiaShader.cpp4
-rw-r--r--libs/hwui/SkiaShader.h9
-rw-r--r--libs/hwui/SpotShadow.cpp10
-rw-r--r--libs/hwui/StatefulBaseRenderer.h3
-rw-r--r--libs/hwui/TessellationCache.cpp2
-rw-r--r--libs/hwui/TessellationCache.h3
-rw-r--r--libs/hwui/TextDropShadowCache.cpp3
-rw-r--r--libs/hwui/font/Font.cpp18
-rw-r--r--libs/hwui/font/FontUtil.h11
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp6
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp6
-rw-r--r--libs/hwui/renderthread/RenderTask.cpp4
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp2
-rw-r--r--libs/hwui/tests/main.cpp4
39 files changed, 357 insertions, 323 deletions
diff --git a/libs/hwui/AmbientShadow.cpp b/libs/hwui/AmbientShadow.cpp
index b2dba00..5840107 100644
--- a/libs/hwui/AmbientShadow.cpp
+++ b/libs/hwui/AmbientShadow.cpp
@@ -121,14 +121,14 @@ inline void computeBufferSize(int* totalVertexCount, int* totalIndexCount,
*totalUmbraCount = 0;
if (!isCasterOpaque) {
// Add the centroid if occluder is translucent.
- *totalVertexCount++;
+ (*totalVertexCount)++;
*totalIndexCount += 2 * innerVertexCount + 1;
*totalUmbraCount = innerVertexCount;
}
}
inline bool needsExtraForEdge(float firstAlpha, float secondAlpha) {
- return abs(firstAlpha - secondAlpha) > ALPHA_THRESHOLD;
+ return fabsf(firstAlpha - secondAlpha) > ALPHA_THRESHOLD;
}
/**
diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk
index 49560ff..d0b9d82 100644
--- a/libs/hwui/Android.mk
+++ b/libs/hwui/Android.mk
@@ -1,110 +1,119 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+
+# Too many unused parameters in external/skia/include and this directory.
+# getConfig in external/skia/include/core/SkBitmap.h is deprecated.
+# Allow Gnu extension: in-class initializer of static 'const float' member.
+LOCAL_CLANG_CFLAGS += \
+ -Wno-gnu-static-float-init
# Only build libhwui when USE_OPENGL_RENDERER is
# defined in the current device/board configuration
ifeq ($(USE_OPENGL_RENDERER),true)
- LOCAL_SRC_FILES := \
- utils/Blur.cpp \
- utils/GLUtils.cpp \
- utils/SortedListImpl.cpp \
- thread/TaskManager.cpp \
- font/CacheTexture.cpp \
- font/Font.cpp \
- AmbientShadow.cpp \
- AnimationContext.cpp \
- Animator.cpp \
- AnimatorManager.cpp \
- AssetAtlas.cpp \
- DamageAccumulator.cpp \
- FontRenderer.cpp \
- GammaFontRenderer.cpp \
- Caches.cpp \
- DisplayList.cpp \
- DeferredDisplayList.cpp \
- DeferredLayerUpdater.cpp \
- DisplayListLogBuffer.cpp \
- DisplayListRenderer.cpp \
- Dither.cpp \
- DrawProfiler.cpp \
- Extensions.cpp \
- FboCache.cpp \
- GradientCache.cpp \
- Image.cpp \
- Interpolator.cpp \
- Layer.cpp \
- LayerCache.cpp \
- LayerRenderer.cpp \
- Matrix.cpp \
- OpenGLRenderer.cpp \
- Patch.cpp \
- PatchCache.cpp \
- PathCache.cpp \
- PathTessellator.cpp \
- PixelBuffer.cpp \
- Program.cpp \
- ProgramCache.cpp \
- RenderBufferCache.cpp \
- RenderNode.cpp \
- RenderProperties.cpp \
- RenderState.cpp \
- ResourceCache.cpp \
- ShadowTessellator.cpp \
- SkiaShader.cpp \
- Snapshot.cpp \
- SpotShadow.cpp \
- StatefulBaseRenderer.cpp \
- Stencil.cpp \
- TessellationCache.cpp \
- Texture.cpp \
- TextureCache.cpp \
- TextDropShadowCache.cpp
+ LOCAL_SRC_FILES := \
+ utils/Blur.cpp \
+ utils/GLUtils.cpp \
+ utils/SortedListImpl.cpp \
+ thread/TaskManager.cpp \
+ font/CacheTexture.cpp \
+ font/Font.cpp \
+ AmbientShadow.cpp \
+ AnimationContext.cpp \
+ Animator.cpp \
+ AnimatorManager.cpp \
+ AssetAtlas.cpp \
+ DamageAccumulator.cpp \
+ FontRenderer.cpp \
+ GammaFontRenderer.cpp \
+ Caches.cpp \
+ DisplayList.cpp \
+ DeferredDisplayList.cpp \
+ DeferredLayerUpdater.cpp \
+ DisplayListLogBuffer.cpp \
+ DisplayListRenderer.cpp \
+ Dither.cpp \
+ DrawProfiler.cpp \
+ Extensions.cpp \
+ FboCache.cpp \
+ GradientCache.cpp \
+ Image.cpp \
+ Interpolator.cpp \
+ Layer.cpp \
+ LayerCache.cpp \
+ LayerRenderer.cpp \
+ Matrix.cpp \
+ OpenGLRenderer.cpp \
+ Patch.cpp \
+ PatchCache.cpp \
+ PathCache.cpp \
+ PathTessellator.cpp \
+ PixelBuffer.cpp \
+ Program.cpp \
+ ProgramCache.cpp \
+ RenderBufferCache.cpp \
+ RenderNode.cpp \
+ RenderProperties.cpp \
+ RenderState.cpp \
+ ResourceCache.cpp \
+ ShadowTessellator.cpp \
+ SkiaShader.cpp \
+ Snapshot.cpp \
+ SpotShadow.cpp \
+ StatefulBaseRenderer.cpp \
+ Stencil.cpp \
+ TessellationCache.cpp \
+ Texture.cpp \
+ TextureCache.cpp \
+ TextDropShadowCache.cpp
# RenderThread stuff
- LOCAL_SRC_FILES += \
- renderthread/CanvasContext.cpp \
- renderthread/DrawFrameTask.cpp \
- renderthread/EglManager.cpp \
- renderthread/RenderProxy.cpp \
- renderthread/RenderTask.cpp \
- renderthread/RenderThread.cpp \
- renderthread/TimeLord.cpp
+ LOCAL_SRC_FILES += \
+ renderthread/CanvasContext.cpp \
+ renderthread/DrawFrameTask.cpp \
+ renderthread/EglManager.cpp \
+ renderthread/RenderProxy.cpp \
+ renderthread/RenderTask.cpp \
+ renderthread/RenderThread.cpp \
+ renderthread/TimeLord.cpp
+
+ intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,)
- intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,)
+ LOCAL_C_INCLUDES += \
+ external/skia/src/core
- LOCAL_C_INCLUDES += \
- external/skia/src/core
+ LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
+ LOCAL_CFLAGS += -Wno-unused-parameter
+ LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+ LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libEGL libGLESv2 libskia libui libgui
+ LOCAL_MODULE := libhwui
+ LOCAL_MODULE_TAGS := optional
- LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
- LOCAL_CFLAGS += -Wno-unused-parameter
- LOCAL_MODULE_CLASS := SHARED_LIBRARIES
- LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libEGL libGLESv2 libskia libui libgui
- LOCAL_MODULE := libhwui
- LOCAL_MODULE_TAGS := optional
+ ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
+ LOCAL_CFLAGS += -DANDROID_ENABLE_RENDERSCRIPT
+ LOCAL_SHARED_LIBRARIES += libRS libRScpp
+ LOCAL_C_INCLUDES += \
+ $(intermediates) \
+ frameworks/rs/cpp \
+ frameworks/rs \
- include external/stlport/libstlport.mk
+ endif
- ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
- LOCAL_CFLAGS += -DANDROID_ENABLE_RENDERSCRIPT
- LOCAL_SHARED_LIBRARIES += libRS libRScpp
- LOCAL_C_INCLUDES += \
- $(intermediates) \
- frameworks/rs/cpp \
- frameworks/rs
- endif
+ ifndef HWUI_COMPILE_SYMBOLS
+ LOCAL_CFLAGS += -fvisibility=hidden
+ endif
- ifndef HWUI_COMPILE_SYMBOLS
- LOCAL_CFLAGS += -fvisibility=hidden
- endif
+ ifdef HWUI_COMPILE_FOR_PERF
+ # TODO: Non-arm?
+ LOCAL_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
+ endif
- ifdef HWUI_COMPILE_FOR_PERF
- LOCAL_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
- endif
+ # Defaults for ATRACE_TAG and LOG_TAG for libhwui
+ LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\"
- # Defaults for ATRACE_TAG and LOG_TAG for libhwui
- LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\"
+ LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
- include $(BUILD_SHARED_LIBRARY)
+ include $(BUILD_SHARED_LIBRARY)
- include $(call all-makefiles-under,$(LOCAL_PATH))
+ include $(call all-makefiles-under,$(LOCAL_PATH))
endif
diff --git a/libs/hwui/AnimationContext.cpp b/libs/hwui/AnimationContext.cpp
index a20bdae..d2152ca 100644
--- a/libs/hwui/AnimationContext.cpp
+++ b/libs/hwui/AnimationContext.cpp
@@ -54,7 +54,7 @@ void AnimationContext::addAnimationHandle(AnimationHandle* handle) {
handle->insertAfter(&mNextFrameAnimations);
}
-void AnimationContext::startFrame(TreeInfo::TraversalMode mode) {
+void AnimationContext::startFrame(TreeInfo::TraversalMode /* mode */) {
LOG_ALWAYS_FATAL_IF(mCurrentFrameAnimations.mNextHandle,
"Missed running animations last frame!");
AnimationHandle* head = mNextFrameAnimations.mNextHandle;
diff --git a/libs/hwui/Animator.cpp b/libs/hwui/Animator.cpp
index 8bf2107..71b7476 100644
--- a/libs/hwui/Animator.cpp
+++ b/libs/hwui/Animator.cpp
@@ -245,11 +245,11 @@ CanvasPropertyPrimitiveAnimator::CanvasPropertyPrimitiveAnimator(
, mProperty(property) {
}
-float CanvasPropertyPrimitiveAnimator::getValue(RenderNode* target) const {
+float CanvasPropertyPrimitiveAnimator::getValue(RenderNode* /* target */) const {
return mProperty->value;
}
-void CanvasPropertyPrimitiveAnimator::setValue(RenderNode* target, float value) {
+void CanvasPropertyPrimitiveAnimator::setValue(RenderNode* /* target */, float value) {
mProperty->value = value;
}
@@ -268,7 +268,7 @@ CanvasPropertyPaintAnimator::CanvasPropertyPaintAnimator(
, mField(field) {
}
-float CanvasPropertyPaintAnimator::getValue(RenderNode* target) const {
+float CanvasPropertyPaintAnimator::getValue(RenderNode* /* target */) const {
switch (mField) {
case STROKE_WIDTH:
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 );
}
-void CanvasPropertyPaintAnimator::setValue(RenderNode* target, float value) {
+void CanvasPropertyPaintAnimator::setValue(RenderNode* /* target */, float value) {
switch (mField) {
case STROKE_WIDTH:
mProperty->value.setStrokeWidth(value);
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index 2e179af..ee54e69 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -382,13 +382,13 @@ private:
bool bindIndicesBufferInternal(const GLuint buffer);
- static void eventMarkNull(GLsizei length, const GLchar* marker) { }
- static void startMarkNull(GLsizei length, const GLchar* marker) { }
+ static void eventMarkNull(GLsizei /* length */, const GLchar* /* marker */) { }
+ static void startMarkNull(GLsizei /* length */, const GLchar* /* marker */) { }
static void endMarkNull() { }
- static void setLabelNull(GLenum type, uint object, GLsizei length,
- const char* label) { }
- static void getLabelNull(GLenum type, uint object, GLsizei bufferSize,
+ static void setLabelNull(GLenum /* type */, uint /* object */, GLsizei /* length */,
+ const char* /* label */) { }
+ static void getLabelNull(GLenum /* type */, uint /* object */, GLsizei /* bufferSize */,
GLsizei* length, char* label) {
if (length) *length = 0;
if (label) *label = '\0';
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp
index fab4a1a..65fd47d 100644
--- a/libs/hwui/DeferredDisplayList.cpp
+++ b/libs/hwui/DeferredDisplayList.cpp
@@ -55,7 +55,7 @@ public:
virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) = 0;
virtual ~Batch() {}
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 {
@@ -91,7 +91,7 @@ public:
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)",
index, this, mOps.size(), getBatchId(), getMergeId());
@@ -269,7 +269,7 @@ public:
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,"
" clip flags %x (batch id %x, merge id %p)",
index, this, mOps.size(), mClipSideFlags, getBatchId(), getMergeId());
@@ -313,7 +313,7 @@ public:
// creates a single operation batch
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);
renderer.restoreDisplayState(*mState);
@@ -332,10 +332,10 @@ private:
class RestoreToCountBatch : public Batch {
public:
- RestoreToCountBatch(const StateOp* op, const DeferredDisplayState* state, int restoreCount) :
- mOp(op), mState(state), mRestoreCount(restoreCount) {}
+ RestoreToCountBatch(const StateOp* /* op */, const DeferredDisplayState* state,
+ int 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);
renderer.restoreDisplayState(*mState);
@@ -345,7 +345,6 @@ public:
private:
// we use the state storage for the RestoreToCountOp, but don't replay the op itself
- const StateOp* mOp;
const DeferredDisplayState* mState;
/*
@@ -699,7 +698,6 @@ void DeferredDisplayList::discardDrawingBatches(const unsigned int maxIndex) {
for (unsigned int i = mEarliestUnclearedIndex; i <= maxIndex; i++) {
// leave deferred state ops alone for simplicity (empty save restore pairs may now exist)
if (mBatches[i] && mBatches[i]->purelyDrawBatch()) {
- DrawBatch* b = (DrawBatch*) mBatches[i];
delete mBatches[i];
mBatches.replaceAt(NULL, i);
}
diff --git a/libs/hwui/DeferredDisplayList.h b/libs/hwui/DeferredDisplayList.h
index 885b411..9d02382 100644
--- a/libs/hwui/DeferredDisplayList.h
+++ b/libs/hwui/DeferredDisplayList.h
@@ -79,7 +79,7 @@ public:
};
class DeferredDisplayList {
- friend class DeferStateStruct; // used to give access to allocator
+ friend struct DeferStateStruct; // used to give access to allocator
public:
DeferredDisplayList(const Rect& bounds) :
mBounds(bounds) {
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index 7a43a2a..a9a9148 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -87,8 +87,7 @@ public:
}
};
-class DeferStateStruct : public PlaybackStateStruct {
-public:
+struct DeferStateStruct : public PlaybackStateStruct {
DeferStateStruct(DeferredDisplayList& deferredList, OpenGLRenderer& renderer, int replayFlags)
: PlaybackStateStruct(renderer, replayFlags, &(deferredList.mAllocator)),
mDeferredList(deferredList) {}
diff --git a/libs/hwui/DisplayListLogBuffer.cpp b/libs/hwui/DisplayListLogBuffer.cpp
index 45aacca..bc9e7bd 100644
--- a/libs/hwui/DisplayListLogBuffer.cpp
+++ b/libs/hwui/DisplayListLogBuffer.cpp
@@ -80,7 +80,7 @@ void DisplayListLogBuffer::outputCommands(FILE *file)
fprintf(file, "%*s%s\n", 2 * tmpBufferPtr->level, "", tmpBufferPtr->label);
- OpLog* nextOp = tmpBufferPtr++;
+ tmpBufferPtr++;
if (tmpBufferPtr > mBufferLast) {
tmpBufferPtr = mBufferFirst;
}
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h
index 8a5e21d..2b05aa1 100644
--- a/libs/hwui/DisplayListOp.h
+++ b/libs/hwui/DisplayListOp.h
@@ -64,7 +64,7 @@ public:
// 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.
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, LinearAllocator& allocator) {
return allocator.alloc(size);
@@ -94,8 +94,8 @@ public:
virtual ~StateOp() {}
- virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
- bool useQuickReject) {
+ virtual void defer(DeferStateStruct& deferStruct, int saveCount, int /* level */,
+ bool /* useQuickReject */) {
// default behavior only affects immediate, deferrable state, issue directly to renderer
applyState(deferStruct.mRenderer, saveCount);
}
@@ -104,8 +104,8 @@ public:
* State operations are applied directly to the renderer, but can cause the deferred drawing op
* list to flush
*/
- virtual void replay(ReplayStateStruct& replayStruct, int saveCount, int level,
- bool useQuickReject) {
+ virtual void replay(ReplayStateStruct& replayStruct, int saveCount, int /* level */,
+ bool /* useQuickReject */) {
applyState(replayStruct.mRenderer, saveCount);
}
@@ -118,7 +118,7 @@ public:
DrawOp(const SkPaint* paint)
: mPaint(paint), mQuickRejected(false) {}
- virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
+ virtual void defer(DeferStateStruct& deferStruct, int /* saveCount */, int /* level */,
bool useQuickReject) {
if (mQuickRejected && CC_LIKELY(useQuickReject)) {
return;
@@ -127,7 +127,7 @@ public:
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) {
if (mQuickRejected && CC_LIKELY(useQuickReject)) {
return;
@@ -146,7 +146,7 @@ public:
* reducing which operations are tagged as mergeable.
*/
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;
for (unsigned int i = 0; i < ops.size(); i++) {
renderer.restoreDisplayState(*(ops[i].state), true);
@@ -165,15 +165,15 @@ public:
*
* if a subclass can set deferInfo.mergeable to true, it should implement multiDraw()
*/
- virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
- const DeferredDisplayState& state) {}
+ virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& /* deferInfo */,
+ const DeferredDisplayState& /* state */) {}
/**
* Query the conservative, local bounds (unmapped) bounds of the op.
*
* returns true if bounds exist
*/
- virtual bool getLocalBounds(Rect& localBounds) {
+ virtual bool getLocalBounds(Rect& /* localBounds */) {
return false;
}
@@ -286,17 +286,17 @@ public:
SaveOp(int flags)
: mFlags(flags) {}
- virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
- bool useQuickReject) {
+ virtual void defer(DeferStateStruct& deferStruct, int /* saveCount */, int /* level */,
+ bool /* useQuickReject */) {
int newSaveCount = deferStruct.mRenderer.save(mFlags);
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);
}
- virtual void output(int level, uint32_t logFlags) const {
+ virtual void output(int level, uint32_t /* logFlags */) const {
OP_LOG("Save flags %x", mFlags);
}
@@ -312,8 +312,8 @@ public:
RestoreToCountOp(int count)
: mCount(count) {}
- virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
- bool useQuickReject) {
+ virtual void defer(DeferStateStruct& deferStruct, int saveCount, int /* level */,
+ bool /* useQuickReject */) {
deferStruct.mDeferredList.addRestoreToCount(deferStruct.mRenderer,
this, saveCount + mCount);
deferStruct.mRenderer.restoreToCount(saveCount + mCount);
@@ -323,7 +323,7 @@ public:
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);
}
@@ -350,8 +350,8 @@ public:
, mConvexMask(NULL)
{}
- virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
- bool useQuickReject) {
+ virtual void defer(DeferStateStruct& deferStruct, int /* saveCount */, int /* level */,
+ bool /* useQuickReject */) {
// NOTE: don't bother with actual saveLayer, instead issuing it at flush time
int newSaveCount = deferStruct.mRenderer.getSaveCount();
deferStruct.mDeferredList.addSaveLayer(deferStruct.mRenderer, this, newSaveCount);
@@ -362,12 +362,12 @@ public:
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,
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,
(isSaveLayerAlpha() ? "Alpha" : ""),RECT_ARGS(mArea));
}
@@ -403,11 +403,11 @@ public:
TranslateOp(float dx, float 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);
}
- 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);
}
@@ -423,11 +423,11 @@ public:
RotateOp(float degrees)
: mDegrees(degrees) {}
- virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
+ virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const {
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);
}
@@ -442,11 +442,11 @@ public:
ScaleOp(float sx, float 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);
}
- 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);
}
@@ -462,11 +462,11 @@ public:
SkewOp(float sx, float 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);
}
- 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);
}
@@ -482,11 +482,11 @@ public:
SetMatrixOp(const SkMatrix& matrix)
: mMatrix(matrix) {}
- virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
+ virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const {
renderer.setMatrix(mMatrix);
}
- virtual void output(int level, uint32_t logFlags) const {
+ virtual void output(int level, uint32_t /* logFlags */) const {
if (mMatrix.isIdentity()) {
OP_LOGS("SetMatrix (reset)");
} else {
@@ -505,11 +505,11 @@ public:
ConcatMatrixOp(const SkMatrix& matrix)
: mMatrix(matrix) {}
- virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
+ virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const {
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));
}
@@ -523,8 +523,8 @@ class ClipOp : public StateOp {
public:
ClipOp(SkRegion::Op op) : mOp(op) {}
- virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
- bool useQuickReject) {
+ virtual void defer(DeferStateStruct& deferStruct, int saveCount, int /* level */,
+ bool /* useQuickReject */) {
// NOTE: must defer op BEFORE applying state, since it may read clip
deferStruct.mDeferredList.addClip(deferStruct.mRenderer, this);
@@ -547,11 +547,11 @@ public:
ClipRectOp(float left, float top, float right, float bottom, SkRegion::Op op)
: 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);
}
- 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));
}
@@ -569,11 +569,11 @@ public:
ClipPathOp(const SkPath* path, SkRegion::Op op)
: ClipOp(op), mPath(path) {}
- virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
+ virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const {
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();
OP_LOG("ClipPath bounds " RECT_STRING,
bounds.left(), bounds.top(), bounds.right(), bounds.bottom());
@@ -590,11 +590,11 @@ public:
ClipRegionOp(const SkRegion* region, SkRegion::Op op)
: ClipOp(op), mRegion(region) {}
- virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
+ virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const {
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();
OP_LOG("ClipRegion bounds %d %d %d %d",
bounds.left(), bounds.top(), bounds.right(), bounds.bottom());
@@ -608,11 +608,11 @@ private:
class ResetPaintFilterOp : public StateOp {
public:
- virtual void applyState(OpenGLRenderer& renderer, int saveCount) const {
+ virtual void applyState(OpenGLRenderer& renderer, int /* saveCount */) const {
renderer.resetPaintFilter();
}
- virtual void output(int level, uint32_t logFlags) const {
+ virtual void output(int level, uint32_t /* logFlags */) const {
OP_LOGS("ResetPaintFilter");
}
@@ -624,11 +624,11 @@ public:
SetupPaintFilterOp(int clearBits, int 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);
}
- 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);
}
@@ -651,7 +651,7 @@ public:
, mEntryValid(false), mEntry(NULL) {
}
- virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
+ virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) {
return renderer.drawBitmap(mBitmap, getPaint(renderer));
}
@@ -672,7 +672,7 @@ public:
* for each bitmap in the batch. This method 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 DeferredDisplayState& firstState = *(ops[0].state);
renderer.restoreDisplayState(firstState, true); // restore all but the clip
@@ -720,7 +720,7 @@ public:
virtual const char* name() { return "DrawBitmap"; }
- virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
+ virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo,
const DeferredDisplayState& state) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap;
deferInfo.mergeId = getAtlasEntry(renderer) ?
@@ -757,21 +757,21 @@ public:
: DrawBoundedOp(dstLeft, dstTop, dstRight, dstBottom, paint),
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,
mLocalBounds.left, mLocalBounds.top, 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 bitmap %p src=" RECT_STRING ", dst=" RECT_STRING,
mBitmap, RECT_ARGS(mSrc), RECT_ARGS(mLocalBounds));
}
virtual const char* name() { return "DrawBitmapRect"; }
- virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
- const DeferredDisplayState& state) {
+ virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo,
+ const DeferredDisplayState& /* state */) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap;
}
@@ -785,18 +785,18 @@ public:
DrawBitmapDataOp(const SkBitmap* bitmap, const SkPaint* 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));
}
- virtual void output(int level, uint32_t logFlags) const {
+ virtual void output(int level, uint32_t /* logFlags */) const {
OP_LOG("Draw bitmap %p", mBitmap);
}
virtual const char* name() { return "DrawBitmapData"; }
- virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
- const DeferredDisplayState& state) {
+ virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo,
+ const DeferredDisplayState& /* state */) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap;
}
};
@@ -809,19 +809,19 @@ public:
mBitmap(bitmap), mMeshWidth(meshWidth), mMeshHeight(meshHeight),
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,
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);
}
virtual const char* name() { return "DrawBitmapMesh"; }
- virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
- const DeferredDisplayState& state) {
+ virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo,
+ const DeferredDisplayState& /* state */) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap;
}
@@ -865,8 +865,8 @@ public:
* and transforming the vertices of each 9-patch in the batch. This method
* is also responsible for dirtying the current layer, if any.
*/
- virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& dirty,
- const Vector<OpStatePair>& ops, const Rect& bounds) {
+ virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& /* dirty */,
+ const Vector<OpStatePair>& ops, const Rect& /* bounds */) {
const DeferredDisplayState& firstState = *(ops[0].state);
renderer.restoreDisplayState(firstState, true); // restore all but the clip
@@ -939,7 +939,7 @@ public:
&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
// This method won't perform the quickReject() since we've already done it at this point
return renderer.drawPatch(mBitmap, getMesh(renderer), getAtlasEntry(renderer),
@@ -954,7 +954,7 @@ public:
virtual const char* name() { return "DrawPatch"; }
- virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
+ virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo,
const DeferredDisplayState& state) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Patch;
deferInfo.mergeId = getAtlasEntry(renderer) ? (mergeid_t) mEntry->getMergeId() : (mergeid_t) mBitmap;
@@ -979,11 +979,11 @@ public:
DrawColorOp(int color, SkXfermode::Mode 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);
}
- 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);
}
@@ -1009,8 +1009,8 @@ public:
return true;
}
- virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
- const DeferredDisplayState& state) {
+ virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo,
+ const DeferredDisplayState& /* state */) {
if (mPaint->getPathEffect()) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_AlphaMaskTexture;
} else {
@@ -1026,12 +1026,12 @@ public:
DrawRectOp(float left, float top, float right, float bottom, const SkPaint* 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,
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));
}
@@ -1051,18 +1051,18 @@ public:
: DrawBoundedOp(rects, count, paint),
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));
}
- 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);
}
virtual const char* name() { return "DrawRects"; }
- virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
- const DeferredDisplayState& state) {
+ virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo,
+ const DeferredDisplayState& /* state */) {
deferInfo.batchId = DeferredDisplayList::kOpBatch_Vertices;
}
@@ -1077,12 +1077,12 @@ public:
float rx, float ry, const SkPaint* paint)
: 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,
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);
}
@@ -1109,12 +1109,12 @@ public:
: DrawOp(paint), mLeft(left), mTop(top), mRight(right), mBottom(bottom),
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,
*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",
*mLeft, *mTop, *mRight, *mBottom, *mRx, *mRy);
}
@@ -1136,11 +1136,11 @@ public:
: DrawStrokableOp(x - radius, y - radius, x + radius, y + radius, 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));
}
- 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);
}
@@ -1157,11 +1157,11 @@ public:
DrawCirclePropsOp(float* x, float* y, float* radius, const SkPaint* paint)
: 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));
}
- 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);
}
@@ -1178,12 +1178,12 @@ public:
DrawOvalOp(float left, float top, float right, float bottom, const SkPaint* 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,
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));
}
@@ -1197,13 +1197,13 @@ public:
: DrawStrokableOp(left, top, right, bottom, paint),
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,
mLocalBounds.right, mLocalBounds.bottom,
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",
RECT_ARGS(mLocalBounds), mStartAngle, mSweepAngle, mUseCenter);
}
@@ -1228,19 +1228,19 @@ public:
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));
}
virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
- const DeferredDisplayState& state) {
+ const DeferredDisplayState& /* state */) {
const SkPaint* paint = getPaint(renderer);
renderer.getCaches().pathCache.precache(mPath, paint);
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));
}
@@ -1258,18 +1258,18 @@ public:
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));
}
- 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);
}
virtual const char* name() { return "DrawLines"; }
- virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
- const DeferredDisplayState& state) {
+ virtual void onDefer(OpenGLRenderer& /* renderer */, DeferInfo& deferInfo,
+ const DeferredDisplayState& /* state */) {
deferInfo.batchId = mPaint->isAntiAlias() ?
DeferredDisplayList::kOpBatch_AlphaVertices :
DeferredDisplayList::kOpBatch_Vertices;
@@ -1285,11 +1285,11 @@ public:
DrawPointsOp(const float* points, int count, const SkPaint* 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));
}
- 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);
}
@@ -1301,7 +1301,7 @@ public:
DrawSomeTextOp(const char* text, int bytesCount, int count, const SkPaint* paint)
: 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);
}
@@ -1310,7 +1310,7 @@ public:
}
virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
- const DeferredDisplayState& state) {
+ const DeferredDisplayState& /* state */) {
const SkPaint* paint = getPaint(renderer);
FontRenderer& fontRenderer = renderer.getCaches().fontRenderer->getFontRenderer(paint);
fontRenderer.precache(paint, mText, mCount, SkMatrix::I());
@@ -1335,7 +1335,7 @@ public:
/* 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,
mHOffset, mVOffset, getPaint(renderer));
}
@@ -1356,7 +1356,7 @@ public:
/* 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));
}
@@ -1400,15 +1400,15 @@ public:
&& OpenGLRenderer::getXfermodeDirect(mPaint) == SkXfermode::kSrcOver_Mode;
}
- virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
+ virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& /* dirty */) {
Rect bounds;
getLocalBounds(bounds);
return renderer.drawText(mText, mBytesCount, mCount, mX, mY,
mPositions, getPaint(renderer), mTotalAdvance, bounds);
}
- virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& dirty,
- const Vector<OpStatePair>& ops, const Rect& bounds) {
+ virtual status_t multiDraw(OpenGLRenderer& renderer, Rect& /* dirty */,
+ const Vector<OpStatePair>& ops, const Rect& /* bounds */) {
status_t status = DrawGlInfo::kStatusDone;
for (unsigned int i = 0; i < ops.size(); i++) {
const DeferredDisplayState& state = *(ops[i].state);
@@ -1425,7 +1425,7 @@ public:
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);
}
@@ -1458,7 +1458,7 @@ public:
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);
}
@@ -1476,21 +1476,21 @@ public:
: DrawBoundedOp(0, 0, renderNode->getWidth(), renderNode->getHeight(), 0),
mRenderNode(renderNode), mFlags(flags), mTransformFromParent(transformFromParent) {}
- virtual void defer(DeferStateStruct& deferStruct, int saveCount, int level,
- bool useQuickReject) {
+ virtual void defer(DeferStateStruct& deferStruct, int /* saveCount */, int level,
+ bool /* useQuickReject */) {
if (mRenderNode->isRenderable() && !mSkipInOrderDraw) {
mRenderNode->defer(deferStruct, level + 1);
}
}
- virtual void replay(ReplayStateStruct& replayStruct, int saveCount, int level,
- bool useQuickReject) {
+ virtual void replay(ReplayStateStruct& replayStruct, int /* saveCount */, int level,
+ bool /* useQuickReject */) {
if (mRenderNode->isRenderable() && !mSkipInOrderDraw) {
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");
return 0;
}
@@ -1544,14 +1544,14 @@ public:
, mCasterOutline(casterOutline) {
}
- virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
+ virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& /* deferInfo */,
const DeferredDisplayState& state) {
renderer.getCaches().tessellationCache.precacheShadows(&state.mMatrix,
renderer.getLocalClipBounds(), isCasterOpaque(), mCasterOutline,
&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;
Matrix4 drawTransform(*(renderer.currentTransform()));
renderer.getCaches().tessellationCache.getShadowBuffers(&drawTransform,
@@ -1562,7 +1562,7 @@ public:
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");
}
@@ -1582,11 +1582,11 @@ public:
DrawLayerOp(Layer* layer, float x, float 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);
}
- 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);
}
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index c2cb76e..399cbfb 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -60,8 +60,8 @@ DisplayListData* DisplayListRenderer::finishRecording() {
return data;
}
-status_t DisplayListRenderer::prepareDirty(float left, float top,
- float right, float bottom, bool opaque) {
+status_t DisplayListRenderer::prepareDirty(float /* left */, float /* top */,
+ float /* right */, float /* bottom */, bool opaque) {
LOG_ALWAYS_FATAL_IF(mDisplayListData,
"prepareDirty called a second time during a recording!");
@@ -87,7 +87,7 @@ void DisplayListRenderer::interrupt() {
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
addDrawOp(new (alloc()) DrawFunctorOp(functor));
mDisplayListData->functors.add(functor);
@@ -178,7 +178,8 @@ bool DisplayListRenderer::clipRegion(const SkRegion* region, SkRegion::Op op) {
return StatefulBaseRenderer::clipRegion(region, op);
}
-status_t DisplayListRenderer::drawRenderNode(RenderNode* renderNode, Rect& dirty, int32_t flags) {
+status_t DisplayListRenderer::drawRenderNode(RenderNode* renderNode, Rect& /* dirty */,
+ int32_t flags) {
LOG_ALWAYS_FATAL_IF(!renderNode, "missing rendernode");
// dirty is an out parameter and should not be recorded,
@@ -394,7 +395,7 @@ static void simplifyPaint(int color, SkPaint* paint) {
status_t DisplayListRenderer::drawText(const char* text, int bytesCount, int count,
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;
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 3910381..27ee0dc 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -47,7 +47,7 @@ namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
// TextSetupFunctor
///////////////////////////////////////////////////////////////////////////////
-status_t TextSetupFunctor::operator ()(int what, void* data) {
+status_t TextSetupFunctor::operator ()(int /* what */, void* data) {
Data* typedData = reinterpret_cast<Data*>(data);
GLenum glyphFormat = typedData ? typedData->glyphFormat : GL_ALPHA;
@@ -358,7 +358,7 @@ void FontRenderer::cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyp
break;
}
case SkMask::kBW_Format: {
- uint32_t cacheX = 0, bX = 0, cacheY = 0, bY = 0;
+ uint32_t cacheX = 0, cacheY = 0;
uint32_t row = (startY - TEXTURE_BORDER_SIZE) * cacheWidth + startX
- TEXTURE_BORDER_SIZE;
static const uint8_t COLORS[2] = { 0, 255 };
diff --git a/libs/hwui/GammaFontRenderer.h b/libs/hwui/GammaFontRenderer.h
index 46cfd04..3abbad0 100644
--- a/libs/hwui/GammaFontRenderer.h
+++ b/libs/hwui/GammaFontRenderer.h
@@ -70,7 +70,7 @@ public:
}
}
- FontRenderer& getFontRenderer(const SkPaint* paint) {
+ FontRenderer& getFontRenderer(const SkPaint* /* paint */) {
if (!mRenderer) {
mRenderer = new FontRenderer;
}
@@ -81,7 +81,7 @@ public:
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;
}
@@ -116,7 +116,7 @@ public:
}
}
- FontRenderer& getFontRenderer(const SkPaint* paint) {
+ FontRenderer& getFontRenderer(const SkPaint* /* paint */) {
if (!mRenderer) {
mRenderer = new FontRenderer;
mRenderer->setGammaTable(&mGammaTable[0]);
@@ -128,14 +128,14 @@ public:
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;
}
- 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();
@@ -171,10 +171,10 @@ public:
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();
diff --git a/libs/hwui/Interpolator.cpp b/libs/hwui/Interpolator.cpp
index ff8ff73..0e62d77 100644
--- a/libs/hwui/Interpolator.cpp
+++ b/libs/hwui/Interpolator.cpp
@@ -14,6 +14,10 @@
* limitations under the License.
*/
+// LOG_TAG is being provided by the Makefile, reset.
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
#define LOG_TAG "Interpolator"
#include "Interpolator.h"
diff --git a/libs/hwui/Layer.h b/libs/hwui/Layer.h
index 64d1d12..2d6a727 100644
--- a/libs/hwui/Layer.h
+++ b/libs/hwui/Layer.h
@@ -47,7 +47,7 @@ class RenderState;
class OpenGLRenderer;
class RenderNode;
class DeferredDisplayList;
-class DeferStateStruct;
+struct DeferStateStruct;
/**
* A layer has dimensions and is backed by an OpenGL texture or FBO.
diff --git a/libs/hwui/LayerCache.cpp b/libs/hwui/LayerCache.cpp
index 3033dc6..3216cd2 100644
--- a/libs/hwui/LayerCache.cpp
+++ b/libs/hwui/LayerCache.cpp
@@ -80,8 +80,10 @@ int LayerCache::LayerEntry::compare(const LayerCache::LayerEntry& lhs,
void LayerCache::deleteLayer(Layer* layer) {
if (layer) {
- LAYER_LOGD("Destroying layer %dx%d, fbo %d", layer->getWidth(), layer->getHeight(),
- layer->getFbo());
+ if (kDebugLayers) {
+ ALOGD("Destroying layer %dx%d, fbo %d", layer->getWidth(), layer->getHeight(),
+ layer->getFbo());
+ }
mSize -= layer->getWidth() * layer->getHeight() * 4;
layer->state = Layer::kState_DeletedFromCache;
layer->decStrong(0);
@@ -110,9 +112,13 @@ Layer* LayerCache::get(RenderState& renderState, const uint32_t width, const uin
layer->state = Layer::kState_RemovedFromCache;
mSize -= layer->getWidth() * layer->getHeight() * 4;
- LAYER_LOGD("Reusing layer %dx%d", layer->getWidth(), layer->getHeight());
+ if (kDebugLayers) {
+ ALOGD("Reusing layer %dx%d", layer->getWidth(), layer->getHeight());
+ }
} else {
- LAYER_LOGD("Creating new layer %dx%d", entry.mWidth, entry.mHeight);
+ if (kDebugLayers) {
+ ALOGD("Creating new layer %dx%d", entry.mWidth, entry.mHeight);
+ }
layer = new Layer(Layer::kType_DisplayList, renderState, entry.mWidth, entry.mHeight);
layer->setBlend(true);
@@ -137,7 +143,9 @@ void LayerCache::dump() {
size_t size = mCache.size();
for (size_t i = 0; i < size; i++) {
const LayerEntry& entry = mCache.itemAt(i);
- LAYER_LOGD(" Layer size %dx%d", entry.mWidth, entry.mHeight);
+ if (kDebugLayers) {
+ ALOGD(" Layer size %dx%d", entry.mWidth, entry.mHeight);
+ }
}
}
@@ -157,8 +165,10 @@ bool LayerCache::put(Layer* layer) {
deleteLayer(victim);
mCache.removeAt(position);
- LAYER_LOGD(" Deleting layer %.2fx%.2f", victim->layer.getWidth(),
- victim->layer.getHeight());
+ if (kDebugLayers) {
+ ALOGD(" Deleting layer %.2fx%.2f", victim->layer.getWidth(),
+ victim->layer.getHeight());
+ }
}
layer->cancelDefer();
diff --git a/libs/hwui/LayerCache.h b/libs/hwui/LayerCache.h
index 6b93e8f..81810ac 100644
--- a/libs/hwui/LayerCache.h
+++ b/libs/hwui/LayerCache.h
@@ -26,15 +26,11 @@ namespace uirenderer {
class RenderState;
-///////////////////////////////////////////////////////////////////////////////
-// Defines
-///////////////////////////////////////////////////////////////////////////////
-
// Debug
#if DEBUG_LAYERS
- #define LAYER_LOGD(...) ALOGD(__VA_ARGS__)
+static const bool kDebugLayers = true;
#else
- #define LAYER_LOGD(...)
+static const bool kDebugLayers = false;
#endif
///////////////////////////////////////////////////////////////////////////////
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 7285496..5cc686e 100755
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -349,7 +349,7 @@ void OpenGLRenderer::resumeAfterLayer() {
dirtyClip();
}
-status_t OpenGLRenderer::callDrawGLFunction(Functor* functor, Rect& dirty) {
+status_t OpenGLRenderer::callDrawGLFunction(Functor* functor, Rect& /* dirty */) {
if (currentSnapshot()->isIgnored()) return DrawGlInfo::kStatusDone;
Rect clip(*currentClipRect());
@@ -402,6 +402,8 @@ void OpenGLRenderer::eventMarkDEBUG(const char* fmt, ...) const {
va_end(ap);
eventMark(buf);
+#else
+ (void)fmt;
#endif
}
@@ -457,7 +459,6 @@ void OpenGLRenderer::renderOverdraw() {
bool OpenGLRenderer::updateLayer(Layer* layer, bool inFrame) {
if (layer->deferredUpdateScheduled && layer->renderer
&& layer->renderNode.get() && layer->renderNode->isRenderable()) {
- Rect& dirty = layer->dirtyRect;
if (inFrame) {
endTiling();
@@ -736,8 +737,10 @@ int OpenGLRenderer::saveLayerDeferred(float left, float top, float right, float
*/
bool OpenGLRenderer::createLayer(float left, float top, float right, float bottom,
const SkPaint* paint, int flags, const SkPath* convexMask) {
- LAYER_LOGD("Requesting layer %.2fx%.2f", right - left, bottom - top);
- LAYER_LOGD("Layer cache size = %d", mCaches.layerCache.getSize());
+ if (kDebugLayers) {
+ ALOGD("Requesting layer %.2fx%.2f", right - left, bottom - top);
+ ALOGD("Layer cache size = %d", mCaches.layerCache.getSize());
+ }
const bool fboLayer = flags & SkCanvas::kClipToLayer_SaveFlag;
@@ -915,7 +918,9 @@ void OpenGLRenderer::composeLayer(const Snapshot& removed, const Snapshot& resto
// Failing to add the layer to the cache should happen only if the layer is too large
layer->setConvexMask(NULL);
if (!mCaches.layerCache.put(layer)) {
- LAYER_LOGD("Deleting layer");
+ if (kDebugLayers) {
+ ALOGD("Deleting layer");
+ }
layer->decStrong(0);
}
}
@@ -1045,7 +1050,7 @@ public:
}
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.");
}
@@ -1928,8 +1933,6 @@ status_t OpenGLRenderer::drawRenderNode(RenderNode* renderNode, Rect& dirty, int
}
void OpenGLRenderer::drawAlphaBitmap(Texture* texture, float left, float top, const SkPaint* paint) {
- int color = paint != NULL ? paint->getColor() : 0;
-
float x = left;
float y = top;
@@ -2351,7 +2354,7 @@ status_t OpenGLRenderer::drawVertexBuffer(float translateX, float translateY,
setupDrawShaderUniforms(getShader(paint));
const void* vertices = vertexBuffer.getBuffer();
- bool force = mCaches.unbindMeshBuffer();
+ mCaches.unbindMeshBuffer();
mCaches.bindPositionVertexPointer(true, vertices, isAA ? gAlphaVertexStride : gVertexStride);
mCaches.resetTexCoordsVertexPointer();
@@ -3126,14 +3129,6 @@ status_t OpenGLRenderer::drawRects(const float* rects, int count, const SkPaint*
return drawColorRects(rects, count, paint, false, true, true);
}
-static void mapPointFakeZ(Vector3& point, const mat4& transformXY, const mat4& transformZ) {
- // map z coordinate with true 3d matrix
- point.z = transformZ.mapZ(point);
-
- // map x,y coordinates with draw/Skia matrix
- transformXY.mapPoint(point.x, point.y);
-}
-
status_t OpenGLRenderer::drawShadow(float casterAlpha,
const VertexBuffer* ambientShadowVertexBuffer, const VertexBuffer* spotShadowVertexBuffer) {
if (currentSnapshot()->isIgnored()) return DrawGlInfo::kStatusDone;
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp
index 6f48e4d..37d70f2 100644
--- a/libs/hwui/PathCache.cpp
+++ b/libs/hwui/PathCache.cpp
@@ -196,7 +196,7 @@ void PathCache::setMaxSize(uint32_t maxSize) {
// Callbacks
///////////////////////////////////////////////////////////////////////////////
-void PathCache::operator()(PathDescription& entry, PathTexture*& texture) {
+void PathCache::operator()(PathDescription& /* entry */, PathTexture*& texture) {
removeTexture(texture);
}
@@ -212,7 +212,7 @@ void PathCache::removeTexture(PathTexture* texture) {
// before attempting our cleanup
const sp<Task<SkBitmap*> >& task = texture->task();
if (task != NULL) {
- SkBitmap* bitmap = task->getResult();
+ task->getResult();
texture->clearTask();
} else {
// If there is a pending task, the path was not added
diff --git a/libs/hwui/PathTessellator.cpp b/libs/hwui/PathTessellator.cpp
index 27ef06f..9f7dd50 100644
--- a/libs/hwui/PathTessellator.cpp
+++ b/libs/hwui/PathTessellator.cpp
@@ -279,7 +279,6 @@ void getStrokeVerticesFromUnclosedVertices(const PaintInfo& paintInfo,
- (vertices[lastIndex].x - vertices[lastIndex - 1].x),
vertices[lastIndex].y - vertices[lastIndex - 1].y);
const float dTheta = PI / (extra + 1);
- const float radialScale = 2.0f / (1 + cos(dTheta));
int capOffset;
for (int i = 0; i < extra; i++) {
@@ -290,14 +289,14 @@ void getStrokeVerticesFromUnclosedVertices(const PaintInfo& paintInfo,
}
beginTheta += dTheta;
- Vector2 beginRadialOffset = {cos(beginTheta), sin(beginTheta)};
+ Vector2 beginRadialOffset = {cosf(beginTheta), sinf(beginTheta)};
paintInfo.scaleOffsetForStrokeWidth(beginRadialOffset);
Vertex::set(&buffer[capOffset],
vertices[0].x + beginRadialOffset.x,
vertices[0].y + beginRadialOffset.y);
endTheta += dTheta;
- Vector2 endRadialOffset = {cos(endTheta), sin(endTheta)};
+ Vector2 endRadialOffset = {cosf(endTheta), sinf(endTheta)};
paintInfo.scaleOffsetForStrokeWidth(endRadialOffset);
Vertex::set(&buffer[allocSize - 1 - capOffset],
vertices[lastIndex].x + endRadialOffset.x,
@@ -468,7 +467,7 @@ inline static void storeCapAA(const PaintInfo& paintInfo, const Vector<Vertex>&
for (int i = 0; i < extra; i++) {
theta += dTheta;
- Vector2 radialOffset = {cos(theta), sin(theta)};
+ Vector2 radialOffset = {cosf(theta), sinf(theta)};
// scale to compensate for pinching at sharp angles, see totalOffsetFromNormals()
radialOffset *= radialScale;
@@ -831,7 +830,6 @@ void PathTessellator::tessellatePoints(const float* points, int count, const SkP
Rect bounds;
// tessellate, then duplicate outline across points
- int numPoints = count / 2;
VertexBuffer tempBuffer;
if (!paintInfo.isAA) {
getFillVerticesFromPerimeter(outlineVertices, tempBuffer);
diff --git a/libs/hwui/Program.h b/libs/hwui/Program.h
index d05b331..fc7d134 100644
--- a/libs/hwui/Program.h
+++ b/libs/hwui/Program.h
@@ -281,6 +281,8 @@ struct ProgramDescription {
programid k = key();
PROGRAM_LOGD("%s (key = 0x%.8x%.8x)", message, uint32_t(k >> 32),
uint32_t(k & 0xffffffff));
+#else
+ (void)message;
#endif
}
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp
index 62835e0..a5b9851 100644
--- a/libs/hwui/ProgramCache.cpp
+++ b/libs/hwui/ProgramCache.cpp
@@ -449,7 +449,7 @@ Program* ProgramCache::get(const ProgramDescription& description) {
// Program generation
///////////////////////////////////////////////////////////////////////////////
-Program* ProgramCache::generateProgram(const ProgramDescription& description, programid key) {
+Program* ProgramCache::generateProgram(const ProgramDescription& description, programid /* key */) {
String8 vertexShader = generateVertexShader(description);
String8 fragmentShader = generateFragmentShader(description);
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index befed16..7b9459a 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -253,7 +253,7 @@ enum DebugLevel {
// Converts a number of kilo-bytes into bytes
#define KB(s) s * 1024
-static DebugLevel readDebugLevel() {
+static inline DebugLevel readDebugLevel() {
char property[PROPERTY_VALUE_MAX];
if (property_get(PROPERTY_DEBUG, property, NULL) > 0) {
return (DebugLevel) atoi(property);
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 787ee62..288899d 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -282,7 +282,7 @@ void RenderNode::pushStagingPropertiesChanges(TreeInfo& info) {
}
}
-void RenderNode::applyLayerPropertiesToLayer(TreeInfo& info) {
+void RenderNode::applyLayerPropertiesToLayer(TreeInfo& /* info */) {
if (CC_LIKELY(!mLayer)) return;
const LayerProperties& props = properties().layerProperties();
@@ -589,7 +589,7 @@ public:
operation->defer(mDeferStruct, saveCount, mLevel, clipToBounds);
}
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 int level() { return mLevel; }
inline int replayFlags() { return mDeferStruct.mReplayFlags; }
@@ -777,7 +777,6 @@ void RenderNode::issueOperationsOf3dChildren(ChildrenSelectMode mode,
int restoreTo = renderer.save(SkCanvas::kMatrix_SaveFlag);
DrawRenderNodeOp* childOp = zTranslatedNodes[drawIndex].value;
- RenderNode* child = childOp->mRenderNode;
renderer.concatMatrix(childOp->mTransformFromParent);
childOp->mSkipInOrderDraw = false; // this is horrible, I'm so sorry everyone
@@ -926,7 +925,7 @@ void RenderNode::issueOperations(OpenGLRenderer& renderer, T& handler) {
initialTransform, zTranslatedNodes, renderer, handler);
- for (int opIndex = chunk.beginOpIndex; opIndex < chunk.endOpIndex; opIndex++) {
+ for (size_t opIndex = chunk.beginOpIndex; opIndex < chunk.endOpIndex; opIndex++) {
DisplayListOp *op = mDisplayListData->displayListOps[opIndex];
#if DEBUG_DISPLAY_LIST
op->output(level + 1);
@@ -934,7 +933,8 @@ void RenderNode::issueOperations(OpenGLRenderer& renderer, T& handler) {
logBuffer.writeCommand(level, op->name());
handler(op, saveCountOffset, properties().getClipToBounds());
- if (CC_UNLIKELY(!mProjectedNodes.isEmpty() && opIndex == projectionReceiveIndex)) {
+ if (CC_UNLIKELY(!mProjectedNodes.isEmpty() && projectionReceiveIndex >= 0 &&
+ opIndex == static_cast<size_t>(projectionReceiveIndex))) {
issueOperationsOfProjectedChildren(renderer, handler);
}
}
diff --git a/libs/hwui/ShadowTessellator.cpp b/libs/hwui/ShadowTessellator.cpp
index c1ffa0a..93d4b31 100644
--- a/libs/hwui/ShadowTessellator.cpp
+++ b/libs/hwui/ShadowTessellator.cpp
@@ -87,7 +87,6 @@ void ShadowTessellator::tessellateSpotShadow(bool isCasterOpaque,
reverseReceiverTransform.loadInverse(receiverTransform);
reverseReceiverTransform.mapPoint3d(adjustedLightCenter);
- const int lightVertexCount = 8;
if (CC_UNLIKELY(caches.propertyLightDiameter > 0)) {
lightRadius = caches.propertyLightDiameter;
}
diff --git a/libs/hwui/SkiaShader.cpp b/libs/hwui/SkiaShader.cpp
index c672bc4..76a70c2 100644
--- a/libs/hwui/SkiaShader.cpp
+++ b/libs/hwui/SkiaShader.cpp
@@ -163,7 +163,7 @@ void SkiaShader::setupProgram(Caches* caches, const mat4& modelViewMatrix,
///////////////////////////////////////////////////////////////////////////////
void SkiaLayerShader::describe(Caches*, ProgramDescription& description,
- const Extensions&, const SkShader& shader) {
+ const Extensions&, const SkShader& /* shader */) {
description.hasBitmap = true;
}
@@ -339,7 +339,7 @@ static bool isSimpleGradient(const SkShader::GradientInfo& gradInfo) {
}
void SkiaGradientShader::describe(Caches*, ProgramDescription& description,
- const Extensions& extensions, const SkShader& shader) {
+ const Extensions& /* extensions */, const SkShader& shader) {
SkShader::GradientInfo gradInfo;
gradInfo.fColorCount = 0;
gradInfo.fColors = NULL;
diff --git a/libs/hwui/SkiaShader.h b/libs/hwui/SkiaShader.h
index 034c3f6..c0a00ee 100644
--- a/libs/hwui/SkiaShader.h
+++ b/libs/hwui/SkiaShader.h
@@ -57,12 +57,13 @@ public:
class InvalidSkiaShader {
public:
- static void describe(Caches* caches, ProgramDescription& description,
- const Extensions& extensions, const SkShader& shader) {
+ static void describe(Caches* /* caches */, ProgramDescription& /* description */,
+ const Extensions& /* extensions */, const SkShader& /* shader */) {
// This shader is unsupported. Skip it.
}
- static void setupProgram(Caches* caches, const mat4& modelViewMatrix,
- GLuint* textureUnit, const Extensions& extensions, const SkShader& shader) {
+ static void setupProgram(Caches* /* caches */, const mat4& /* modelViewMatrix */,
+ GLuint* /* textureUnit */, const Extensions& /* extensions */,
+ const SkShader& /* shader */) {
// This shader is unsupported. Skip it.
}
diff --git a/libs/hwui/SpotShadow.cpp b/libs/hwui/SpotShadow.cpp
index b2dd899..df068e6 100644
--- a/libs/hwui/SpotShadow.cpp
+++ b/libs/hwui/SpotShadow.cpp
@@ -797,11 +797,15 @@ inline void genNewPenumbraAndPairWithUmbra(const Vector2* penumbra, int penumbra
previousPenumbra * weightForPreviousPenumbra;
int skippedUmbraIndex = (previousClosestUmbraIndex + k + 1) % umbraLength;
- verticesPair[verticesPairIndex++] = {newPenumbraIndex, skippedUmbraIndex};
+ verticesPair[verticesPairIndex].outerIndex = newPenumbraIndex;
+ verticesPair[verticesPairIndex].innerIndex = skippedUmbraIndex;
+ verticesPairIndex++;
newPenumbra[newPenumbraIndex++] = interpolatedPenumbra;
}
}
- verticesPair[verticesPairIndex++] = {newPenumbraIndex, currentClosestUmbraIndex};
+ verticesPair[verticesPairIndex].outerIndex = newPenumbraIndex;
+ verticesPair[verticesPairIndex].innerIndex = currentClosestUmbraIndex;
+ verticesPairIndex++;
newPenumbra[newPenumbraIndex++] = currentPenumbraVertex;
previousClosestUmbraIndex = currentClosestUmbraIndex;
@@ -866,7 +870,7 @@ inline Vector2 getCloserVertex(const Vector2& umbraVertex, const Vector2& centro
/**
* 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,
const Vector3* poly, int polyLength, VertexBuffer& shadowTriangleStrip,
const Vector2& centroid) {
diff --git a/libs/hwui/StatefulBaseRenderer.h b/libs/hwui/StatefulBaseRenderer.h
index 745e48a..a8e4f88 100644
--- a/libs/hwui/StatefulBaseRenderer.h
+++ b/libs/hwui/StatefulBaseRenderer.h
@@ -129,7 +129,8 @@ protected:
*
* Subclasses can override this method to handle layer restoration
*/
- virtual void onSnapshotRestored(const Snapshot& removed, const Snapshot& restored) {};
+ virtual void onSnapshotRestored(const Snapshot& /* removed */,
+ const Snapshot& /* restored */) {};
virtual void onViewportInitialized() {};
diff --git a/libs/hwui/TessellationCache.cpp b/libs/hwui/TessellationCache.cpp
index 1e38f9e..35ec5e9 100644
--- a/libs/hwui/TessellationCache.cpp
+++ b/libs/hwui/TessellationCache.cpp
@@ -365,7 +365,7 @@ void TessellationCache::clear() {
// Callbacks
///////////////////////////////////////////////////////////////////////////////
-void TessellationCache::BufferRemovedListener::operator()(Description& description,
+void TessellationCache::BufferRemovedListener::operator()(Description& /* description */,
Buffer*& buffer) {
delete buffer;
}
diff --git a/libs/hwui/TessellationCache.h b/libs/hwui/TessellationCache.h
index 688a699..a05c690 100644
--- a/libs/hwui/TessellationCache.h
+++ b/libs/hwui/TessellationCache.h
@@ -178,7 +178,8 @@ private:
// holds a pointer, and implicit strong ref to each shadow task of the frame
LruCache<ShadowDescription, Task<vertexBuffer_pair_t*>*> mShadowCache;
class BufferPairRemovedListener : public OnEntryRemoved<ShadowDescription, Task<vertexBuffer_pair_t*>*> {
- void operator()(ShadowDescription& description, Task<vertexBuffer_pair_t*>*& bufferPairTask) {
+ void operator()(ShadowDescription& /* description */,
+ Task<vertexBuffer_pair_t*>*& bufferPairTask) {
bufferPairTask->decStrong(NULL);
}
};
diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp
index 4eec462..96c09e6 100644
--- a/libs/hwui/TextDropShadowCache.cpp
+++ b/libs/hwui/TextDropShadowCache.cpp
@@ -40,7 +40,8 @@ hash_t ShadowText::hash() const {
hash = JenkinsHashMix(hash, android::hash_type(italicStyle));
hash = JenkinsHashMix(hash, android::hash_type(scaleX));
if (text) {
- hash = JenkinsHashMixShorts(hash, text, charCount);
+ hash = JenkinsHashMixShorts(
+ hash, reinterpret_cast<const uint16_t*>(text), charCount);
}
if (positions) {
for (uint32_t i = 0; i < charCount * 2; i++) {
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp
index af39f16..d73d9ac 100644
--- a/libs/hwui/font/Font.cpp
+++ b/libs/hwui/font/Font.cpp
@@ -139,7 +139,8 @@ void Font::invalidateTextureCache(CacheTexture* cacheTexture) {
}
void Font::measureCachedGlyph(CachedGlyphInfo *glyph, int x, int y,
- uint8_t* bitmap, uint32_t bitmapW, uint32_t bitmapH, Rect* bounds, const float* pos) {
+ uint8_t* /* bitmap */, uint32_t /* bitmapW */, uint32_t /* bitmapH */, Rect* bounds,
+ const float* /* pos */) {
int width = (int) glyph->mBitmapWidth;
int height = (int) glyph->mBitmapHeight;
@@ -161,7 +162,8 @@ void Font::measureCachedGlyph(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, const float* pos) {
+ uint8_t* /* bitmap */, uint32_t /* bitmapW */, uint32_t /* bitmapH */, Rect* /* bounds */,
+ const float* /* pos */) {
float width = (float) glyph->mBitmapWidth;
float height = (float) glyph->mBitmapHeight;
@@ -180,7 +182,8 @@ void Font::drawCachedGlyph(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, const float* pos) {
+ uint8_t* /* bitmap */, uint32_t /* bitmapW */, uint32_t /* bitmapH */, Rect* /* bounds */,
+ const float* /* pos */) {
float width = (float) glyph->mBitmapWidth;
float height = (float) glyph->mBitmapHeight;
@@ -210,7 +213,8 @@ void Font::drawCachedGlyphTransformed(CachedGlyphInfo* glyph, int x, int y,
}
void Font::drawCachedGlyphBitmap(CachedGlyphInfo* glyph, int x, int y, uint8_t* bitmap,
- uint32_t bitmapWidth, uint32_t bitmapHeight, Rect* bounds, const float* pos) {
+ uint32_t bitmapWidth, uint32_t /* bitmapHeight */, Rect* /* bounds */,
+ const float* /* pos */) {
int dstX = x + glyph->mBitmapLeft;
int dstY = y + glyph->mBitmapTop;
@@ -378,7 +382,7 @@ void Font::precache(const SkPaint* paint, const char* text, int numGlyphs) {
break;
}
- CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph, true);
+ getCachedGlyph(paint, glyph, true);
glyphsCount++;
}
}
@@ -403,8 +407,6 @@ void Font::render(const SkPaint* paint, const char* text, uint32_t start, uint32
text += start;
int glyphsCount = 0;
- const SkPaint::Align align = paint->getTextAlign();
-
while (glyphsCount < numGlyphs) {
glyph_t glyph = GET_GLYPH(text);
@@ -429,7 +431,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) {
glyph->mAdvanceX = skiaGlyph.fAdvanceX;
glyph->mAdvanceY = skiaGlyph.fAdvanceY;
diff --git a/libs/hwui/font/FontUtil.h b/libs/hwui/font/FontUtil.h
index c2fd5f5..4e5debe 100644
--- a/libs/hwui/font/FontUtil.h
+++ b/libs/hwui/font/FontUtil.h
@@ -30,9 +30,12 @@
#define DEFAULT_TEXT_LARGE_CACHE_WIDTH 2048
#define DEFAULT_TEXT_LARGE_CACHE_HEIGHT 512
-#define TEXTURE_BORDER_SIZE 1
-#if TEXTURE_BORDER_SIZE != 1
-# error TEXTURE_BORDER_SIZE other than 1 is not currently supported
+#ifdef TEXTURE_BORDER_SIZE
+ #if TEXTURE_BORDER_SIZE != 1
+ #error TEXTURE_BORDER_SIZE other than 1 is not currently supported
+ #endif
+#else
+ #define TEXTURE_BORDER_SIZE 1
#endif
#define CACHE_BLOCK_ROUNDING_SIZE 4
@@ -44,7 +47,7 @@
#define GET_GLYPH(text) nextGlyph((const uint16_t**) &text)
#define IS_END_OF_STRING(glyph) false
- static glyph_t nextGlyph(const uint16_t** srcPtr) {
+ static inline glyph_t nextGlyph(const uint16_t** srcPtr) {
const uint16_t* src = *srcPtr;
glyph_t g = *src++;
*srcPtr = src;
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 75bd067..5aeecd2 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -123,13 +123,13 @@ void CanvasContext::updateSurface(ANativeWindow* window) {
setSurface(window);
}
-bool CanvasContext::pauseSurface(ANativeWindow* window) {
+bool CanvasContext::pauseSurface(ANativeWindow* /* window */) {
return mRenderThread.removeFrameCallback(this);
}
// TODO: don't pass viewport size, it's automatic via EGL
-void CanvasContext::setup(int width, int height, const Vector3& lightCenter, float lightRadius,
- uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha) {
+void CanvasContext::setup(int /* width */, int /* height */, const Vector3& lightCenter,
+ float lightRadius, uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha) {
if (!mCanvas) return;
mCanvas->initLight(lightCenter, lightRadius, ambientShadowAlpha, spotShadowAlpha);
}
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 6d063a4..36ba3a9 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -339,13 +339,19 @@ void RenderProxy::trimMemory(int level) {
}
}
+template <typename T>
+void UNUSED(T) {}
+
+
CREATE_BRIDGE0(fence) {
// Intentionally empty
+ UNUSED(args);
return NULL;
}
void RenderProxy::fence() {
SETUP_TASK(fence);
+ UNUSED(args);
postAndWait(task);
}
diff --git a/libs/hwui/renderthread/RenderTask.cpp b/libs/hwui/renderthread/RenderTask.cpp
index 7ca61e4..13970ba 100644
--- a/libs/hwui/renderthread/RenderTask.cpp
+++ b/libs/hwui/renderthread/RenderTask.cpp
@@ -14,6 +14,10 @@
* limitations under the License.
*/
+// LOG_TAG is being provided by the Makefile, reset.
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
#define LOG_TAG "RenderTask"
#include "RenderTask.h"
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 38cb4cd..6a55475 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -171,7 +171,7 @@ void RenderThread::initThreadLocals() {
mRenderState = new RenderState(*this);
}
-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)) {
ALOGE("Display event receiver pipe was closed or an error occurred. "
"events=0x%x", events);
diff --git a/libs/hwui/tests/main.cpp b/libs/hwui/tests/main.cpp
index 2d99e9f..d847d13 100644
--- a/libs/hwui/tests/main.cpp
+++ b/libs/hwui/tests/main.cpp
@@ -66,7 +66,7 @@ sp<RenderNode> createCard(int x, int y, int width, int height) {
return node;
}
-int main(int argc, char* argv[]) {
+int main() {
createTestEnvironment();
// create the native surface
@@ -111,7 +111,7 @@ int main(int argc, char* argv[]) {
for (int i = 0; i < 150; i++) {
ATRACE_NAME("UI-Draw Frame");
- for (int ci = 0; ci < cards.size(); ci++) {
+ for (size_t ci = 0; ci < cards.size(); ci++) {
cards[ci]->mutateStagingProperties().setTranslationX(i);
cards[ci]->mutateStagingProperties().setTranslationY(i);
cards[ci]->setPropertyFieldsDirty(RenderNode::X | RenderNode::Y);