resolved conflicts for merge of 1d03b816 to lmp-mr1-dev-plus-aosp

Change-Id: Ib673768fe5fc03615626ef4b10590e5317f22172
This commit is contained in:
Andreas Gampe
2014-11-10 20:54:07 -08:00
21 changed files with 158 additions and 146 deletions

View File

@@ -121,7 +121,7 @@ inline void computeBufferSize(int* totalVertexCount, int* totalIndexCount,
*totalUmbraCount = 0; *totalUmbraCount = 0;
if (!isCasterOpaque) { if (!isCasterOpaque) {
// Add the centroid if occluder is translucent. // Add the centroid if occluder is translucent.
*totalVertexCount++; (*totalVertexCount)++;
*totalIndexCount += 2 * innerVertexCount + 1; *totalIndexCount += 2 * innerVertexCount + 1;
*totalUmbraCount = innerVertexCount; *totalUmbraCount = innerVertexCount;
} }

View File

@@ -13,107 +13,110 @@ LOCAL_CLANG_CFLAGS += \
# Only build libhwui when USE_OPENGL_RENDERER is # Only build libhwui when USE_OPENGL_RENDERER is
# defined in the current device/board configuration # defined in the current device/board configuration
ifeq ($(USE_OPENGL_RENDERER),true) ifeq ($(USE_OPENGL_RENDERER),true)
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
utils/Blur.cpp \ utils/Blur.cpp \
utils/GLUtils.cpp \ utils/GLUtils.cpp \
utils/SortedListImpl.cpp \ utils/SortedListImpl.cpp \
thread/TaskManager.cpp \ thread/TaskManager.cpp \
font/CacheTexture.cpp \ font/CacheTexture.cpp \
font/Font.cpp \ font/Font.cpp \
AmbientShadow.cpp \ AmbientShadow.cpp \
AnimationContext.cpp \ AnimationContext.cpp \
Animator.cpp \ Animator.cpp \
AnimatorManager.cpp \ AnimatorManager.cpp \
AssetAtlas.cpp \ AssetAtlas.cpp \
DamageAccumulator.cpp \ DamageAccumulator.cpp \
FontRenderer.cpp \ FontRenderer.cpp \
GammaFontRenderer.cpp \ GammaFontRenderer.cpp \
Caches.cpp \ Caches.cpp \
DisplayList.cpp \ DisplayList.cpp \
DeferredDisplayList.cpp \ DeferredDisplayList.cpp \
DeferredLayerUpdater.cpp \ DeferredLayerUpdater.cpp \
DisplayListLogBuffer.cpp \ DisplayListLogBuffer.cpp \
DisplayListRenderer.cpp \ DisplayListRenderer.cpp \
Dither.cpp \ Dither.cpp \
DrawProfiler.cpp \ DrawProfiler.cpp \
Extensions.cpp \ Extensions.cpp \
FboCache.cpp \ FboCache.cpp \
GradientCache.cpp \ GradientCache.cpp \
Image.cpp \ Image.cpp \
Interpolator.cpp \ Interpolator.cpp \
Layer.cpp \ Layer.cpp \
LayerCache.cpp \ LayerCache.cpp \
LayerRenderer.cpp \ LayerRenderer.cpp \
Matrix.cpp \ Matrix.cpp \
OpenGLRenderer.cpp \ OpenGLRenderer.cpp \
Patch.cpp \ Patch.cpp \
PatchCache.cpp \ PatchCache.cpp \
PathCache.cpp \ PathCache.cpp \
PathTessellator.cpp \ PathTessellator.cpp \
PixelBuffer.cpp \ PixelBuffer.cpp \
Program.cpp \ Program.cpp \
ProgramCache.cpp \ ProgramCache.cpp \
RenderBufferCache.cpp \ RenderBufferCache.cpp \
RenderNode.cpp \ RenderNode.cpp \
RenderProperties.cpp \ RenderProperties.cpp \
RenderState.cpp \ RenderState.cpp \
ResourceCache.cpp \ ResourceCache.cpp \
ShadowTessellator.cpp \ ShadowTessellator.cpp \
SkiaShader.cpp \ SkiaShader.cpp \
Snapshot.cpp \ Snapshot.cpp \
SpotShadow.cpp \ SpotShadow.cpp \
StatefulBaseRenderer.cpp \ StatefulBaseRenderer.cpp \
Stencil.cpp \ Stencil.cpp \
TessellationCache.cpp \ TessellationCache.cpp \
Texture.cpp \ Texture.cpp \
TextureCache.cpp \ TextureCache.cpp \
TextDropShadowCache.cpp TextDropShadowCache.cpp
# RenderThread stuff # RenderThread stuff
LOCAL_SRC_FILES += \ LOCAL_SRC_FILES += \
renderthread/CanvasContext.cpp \ renderthread/CanvasContext.cpp \
renderthread/DrawFrameTask.cpp \ renderthread/DrawFrameTask.cpp \
renderthread/EglManager.cpp \ renderthread/EglManager.cpp \
renderthread/RenderProxy.cpp \ renderthread/RenderProxy.cpp \
renderthread/RenderTask.cpp \ renderthread/RenderTask.cpp \
renderthread/RenderThread.cpp \ renderthread/RenderThread.cpp \
renderthread/TimeLord.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 += \ LOCAL_C_INCLUDES += \
external/skia/src/core external/skia/src/core
LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES
LOCAL_CFLAGS += -Wno-unused-parameter LOCAL_CFLAGS += -Wno-unused-parameter
LOCAL_MODULE_CLASS := SHARED_LIBRARIES LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libEGL libGLESv2 libskia libui libgui LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libEGL libGLESv2 libskia libui libgui
LOCAL_MODULE := libhwui LOCAL_MODULE := libhwui
LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional
ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT)) ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
LOCAL_CFLAGS += -DANDROID_ENABLE_RENDERSCRIPT LOCAL_CFLAGS += -DANDROID_ENABLE_RENDERSCRIPT
LOCAL_SHARED_LIBRARIES += libRS libRScpp LOCAL_SHARED_LIBRARIES += libRS libRScpp
LOCAL_C_INCLUDES += \ LOCAL_C_INCLUDES += \
$(intermediates) \ $(intermediates) \
frameworks/rs/cpp \ frameworks/rs/cpp \
frameworks/rs \ frameworks/rs \
endif endif
ifndef HWUI_COMPILE_SYMBOLS ifndef HWUI_COMPILE_SYMBOLS
LOCAL_CFLAGS += -fvisibility=hidden LOCAL_CFLAGS += -fvisibility=hidden
endif endif
ifdef HWUI_COMPILE_FOR_PERF ifdef HWUI_COMPILE_FOR_PERF
LOCAL_CFLAGS += -fno-omit-frame-pointer -marm -mapcs # TODO: Non-arm?
endif LOCAL_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
endif
# Defaults for ATRACE_TAG and LOG_TAG for libhwui # Defaults for ATRACE_TAG and LOG_TAG for libhwui
LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" LOCAL_CFLAGS += -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\"
include external/stlport/libstlport.mk LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
include $(BUILD_SHARED_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH)) include external/stlport/libstlport.mk
include $(BUILD_SHARED_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))
endif endif

View File

@@ -333,7 +333,7 @@ private:
class RestoreToCountBatch : public Batch { class RestoreToCountBatch : public Batch {
public: public:
RestoreToCountBatch(const StateOp* op, const DeferredDisplayState* state, int restoreCount) : RestoreToCountBatch(const StateOp* op, const DeferredDisplayState* state, int restoreCount) :
mOp(op), 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);
@@ -345,7 +345,6 @@ public:
private: private:
// we use the state storage for the RestoreToCountOp, but don't replay the op itself // we use the state storage for the RestoreToCountOp, but don't replay the op itself
const StateOp* mOp;
const DeferredDisplayState* mState; const DeferredDisplayState* mState;
/* /*
@@ -699,7 +698,6 @@ void DeferredDisplayList::discardDrawingBatches(const unsigned int maxIndex) {
for (unsigned int i = mEarliestUnclearedIndex; i <= maxIndex; i++) { for (unsigned int i = mEarliestUnclearedIndex; i <= maxIndex; i++) {
// leave deferred state ops alone for simplicity (empty save restore pairs may now exist) // leave deferred state ops alone for simplicity (empty save restore pairs may now exist)
if (mBatches[i] && mBatches[i]->purelyDrawBatch()) { if (mBatches[i] && mBatches[i]->purelyDrawBatch()) {
DrawBatch* b = (DrawBatch*) mBatches[i];
delete mBatches[i]; delete mBatches[i];
mBatches.replaceAt(NULL, i); mBatches.replaceAt(NULL, i);
} }

View File

@@ -79,7 +79,7 @@ public:
}; };
class DeferredDisplayList { class DeferredDisplayList {
friend class DeferStateStruct; // used to give access to allocator friend struct DeferStateStruct; // used to give access to allocator
public: public:
DeferredDisplayList(const Rect& bounds) : DeferredDisplayList(const Rect& bounds) :
mBounds(bounds) { mBounds(bounds) {

View File

@@ -91,8 +91,7 @@ private:
std::vector<SkPath> mTempPaths; std::vector<SkPath> mTempPaths;
}; };
class DeferStateStruct : public PlaybackStateStruct { struct DeferStateStruct : public PlaybackStateStruct {
public:
DeferStateStruct(DeferredDisplayList& deferredList, OpenGLRenderer& renderer, int replayFlags) DeferStateStruct(DeferredDisplayList& deferredList, OpenGLRenderer& renderer, int replayFlags)
: PlaybackStateStruct(renderer, replayFlags, &(deferredList.mAllocator)), : PlaybackStateStruct(renderer, replayFlags, &(deferredList.mAllocator)),
mDeferredList(deferredList) {} mDeferredList(deferredList) {}

View File

@@ -80,7 +80,7 @@ void DisplayListLogBuffer::outputCommands(FILE *file)
fprintf(file, "%*s%s\n", 2 * tmpBufferPtr->level, "", tmpBufferPtr->label); fprintf(file, "%*s%s\n", 2 * tmpBufferPtr->level, "", tmpBufferPtr->label);
OpLog* nextOp = tmpBufferPtr++; tmpBufferPtr++;
if (tmpBufferPtr > mBufferLast) { if (tmpBufferPtr > mBufferLast) {
tmpBufferPtr = mBufferFirst; tmpBufferPtr = mBufferFirst;
} }

View File

@@ -358,7 +358,7 @@ void FontRenderer::cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyp
break; break;
} }
case SkMask::kBW_Format: { 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 uint32_t row = (startY - TEXTURE_BORDER_SIZE) * cacheWidth + startX
- TEXTURE_BORDER_SIZE; - TEXTURE_BORDER_SIZE;
static const uint8_t COLORS[2] = { 0, 255 }; static const uint8_t COLORS[2] = { 0, 255 };

View File

@@ -14,6 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
// LOG_TAG is being provided by the Makefile, reset.
#ifdef LOG_TAG
#undef LOG_TAG
#endif
#define LOG_TAG "Interpolator" #define LOG_TAG "Interpolator"
#include "Interpolator.h" #include "Interpolator.h"

View File

@@ -80,8 +80,10 @@ int LayerCache::LayerEntry::compare(const LayerCache::LayerEntry& lhs,
void LayerCache::deleteLayer(Layer* layer) { void LayerCache::deleteLayer(Layer* layer) {
if (layer) { if (layer) {
LAYER_LOGD("Destroying layer %dx%d, fbo %d", layer->getWidth(), layer->getHeight(), if (kDebugLayers) {
layer->getFbo()); ALOGD("Destroying layer %dx%d, fbo %d", layer->getWidth(), layer->getHeight(),
layer->getFbo());
}
mSize -= layer->getWidth() * layer->getHeight() * 4; mSize -= layer->getWidth() * layer->getHeight() * 4;
layer->state = Layer::kState_DeletedFromCache; layer->state = Layer::kState_DeletedFromCache;
layer->decStrong(0); layer->decStrong(0);
@@ -110,9 +112,13 @@ Layer* LayerCache::get(RenderState& renderState, const uint32_t width, const uin
layer->state = Layer::kState_RemovedFromCache; layer->state = Layer::kState_RemovedFromCache;
mSize -= layer->getWidth() * layer->getHeight() * 4; 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 { } 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 = new Layer(Layer::kType_DisplayList, renderState, entry.mWidth, entry.mHeight);
layer->setBlend(true); layer->setBlend(true);
@@ -137,7 +143,9 @@ void LayerCache::dump() {
size_t size = mCache.size(); size_t size = mCache.size();
for (size_t i = 0; i < size; i++) { for (size_t i = 0; i < size; i++) {
const LayerEntry& entry = mCache.itemAt(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); deleteLayer(victim);
mCache.removeAt(position); mCache.removeAt(position);
LAYER_LOGD(" Deleting layer %.2fx%.2f", victim->layer.getWidth(), if (kDebugLayers) {
victim->layer.getHeight()); ALOGD(" Deleting layer %.2fx%.2f", victim->layer.getWidth(),
victim->layer.getHeight());
}
} }
layer->cancelDefer(); layer->cancelDefer();

View File

@@ -26,15 +26,11 @@ namespace uirenderer {
class RenderState; class RenderState;
///////////////////////////////////////////////////////////////////////////////
// Defines
///////////////////////////////////////////////////////////////////////////////
// Debug // Debug
#if DEBUG_LAYERS #if DEBUG_LAYERS
#define LAYER_LOGD(...) ALOGD(__VA_ARGS__) static const bool kDebugLayers = true;
#else #else
#define LAYER_LOGD(...) static const bool kDebugLayers = false;
#endif #endif
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@@ -468,8 +468,6 @@ bool OpenGLRenderer::updateLayer(Layer* layer, bool inFrame) {
&& layer->renderNode.get() && layer->renderNode->isRenderable()) { && layer->renderNode.get() && layer->renderNode->isRenderable()) {
ATRACE_CALL(); ATRACE_CALL();
Rect& dirty = layer->dirtyRect;
if (inFrame) { if (inFrame) {
endTiling(); endTiling();
debugOverdraw(false, false); debugOverdraw(false, false);
@@ -757,8 +755,10 @@ int OpenGLRenderer::saveLayerDeferred(float left, float top, float right, float
*/ */
bool OpenGLRenderer::createLayer(float left, float top, float right, float bottom, bool OpenGLRenderer::createLayer(float left, float top, float right, float bottom,
const SkPaint* paint, int flags, const SkPath* convexMask) { const SkPaint* paint, int flags, const SkPath* convexMask) {
LAYER_LOGD("Requesting layer %.2fx%.2f", right - left, bottom - top); if (kDebugLayers) {
LAYER_LOGD("Layer cache size = %d", mCaches.layerCache.getSize()); ALOGD("Requesting layer %.2fx%.2f", right - left, bottom - top);
ALOGD("Layer cache size = %d", mCaches.layerCache.getSize());
}
const bool fboLayer = flags & SkCanvas::kClipToLayer_SaveFlag; const bool fboLayer = flags & SkCanvas::kClipToLayer_SaveFlag;
@@ -936,7 +936,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 // Failing to add the layer to the cache should happen only if the layer is too large
layer->setConvexMask(NULL); layer->setConvexMask(NULL);
if (!mCaches.layerCache.put(layer)) { if (!mCaches.layerCache.put(layer)) {
LAYER_LOGD("Deleting layer"); if (kDebugLayers) {
ALOGD("Deleting layer");
}
layer->decStrong(0); layer->decStrong(0);
} }
} }
@@ -1955,8 +1957,6 @@ status_t OpenGLRenderer::drawRenderNode(RenderNode* renderNode, Rect& dirty, int
} }
void OpenGLRenderer::drawAlphaBitmap(Texture* texture, float left, float top, const SkPaint* paint) { void OpenGLRenderer::drawAlphaBitmap(Texture* texture, float left, float top, const SkPaint* paint) {
int color = paint != NULL ? paint->getColor() : 0;
float x = left; float x = left;
float y = top; float y = top;
@@ -2378,7 +2378,7 @@ status_t OpenGLRenderer::drawVertexBuffer(float translateX, float translateY,
setupDrawShaderUniforms(getShader(paint)); setupDrawShaderUniforms(getShader(paint));
const void* vertices = vertexBuffer.getBuffer(); const void* vertices = vertexBuffer.getBuffer();
bool force = mCaches.unbindMeshBuffer(); mCaches.unbindMeshBuffer();
mCaches.bindPositionVertexPointer(true, vertices, isAA ? gAlphaVertexStride : gVertexStride); mCaches.bindPositionVertexPointer(true, vertices, isAA ? gAlphaVertexStride : gVertexStride);
mCaches.resetTexCoordsVertexPointer(); mCaches.resetTexCoordsVertexPointer();
@@ -3153,14 +3153,6 @@ status_t OpenGLRenderer::drawRects(const float* rects, int count, const SkPaint*
return drawColorRects(rects, count, paint, false, true, true); 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, status_t OpenGLRenderer::drawShadow(float casterAlpha,
const VertexBuffer* ambientShadowVertexBuffer, const VertexBuffer* spotShadowVertexBuffer) { const VertexBuffer* ambientShadowVertexBuffer, const VertexBuffer* spotShadowVertexBuffer) {
if (currentSnapshot()->isIgnored()) return DrawGlInfo::kStatusDone; if (currentSnapshot()->isIgnored()) return DrawGlInfo::kStatusDone;

View File

@@ -212,7 +212,7 @@ void PathCache::removeTexture(PathTexture* texture) {
// before attempting our cleanup // before attempting our cleanup
const sp<Task<SkBitmap*> >& task = texture->task(); const sp<Task<SkBitmap*> >& task = texture->task();
if (task != NULL) { if (task != NULL) {
SkBitmap* bitmap = task->getResult(); task->getResult();
texture->clearTask(); texture->clearTask();
} else { } else {
// If there is a pending task, the path was not added // If there is a pending task, the path was not added

View File

@@ -279,7 +279,6 @@ void getStrokeVerticesFromUnclosedVertices(const PaintInfo& paintInfo,
- (vertices[lastIndex].x - vertices[lastIndex - 1].x), - (vertices[lastIndex].x - vertices[lastIndex - 1].x),
vertices[lastIndex].y - vertices[lastIndex - 1].y); vertices[lastIndex].y - vertices[lastIndex - 1].y);
const float dTheta = PI / (extra + 1); const float dTheta = PI / (extra + 1);
const float radialScale = 2.0f / (1 + cos(dTheta));
int capOffset; int capOffset;
for (int i = 0; i < extra; i++) { for (int i = 0; i < extra; i++) {
@@ -831,7 +830,6 @@ void PathTessellator::tessellatePoints(const float* points, int count, const SkP
Rect bounds; Rect bounds;
// tessellate, then duplicate outline across points // tessellate, then duplicate outline across points
int numPoints = count / 2;
VertexBuffer tempBuffer; VertexBuffer tempBuffer;
if (!paintInfo.isAA) { if (!paintInfo.isAA) {
getFillVerticesFromPerimeter(outlineVertices, tempBuffer); getFillVerticesFromPerimeter(outlineVertices, tempBuffer);

View File

@@ -253,7 +253,7 @@ enum DebugLevel {
// Converts a number of kilo-bytes into bytes // Converts a number of kilo-bytes into bytes
#define KB(s) s * 1024 #define KB(s) s * 1024
static DebugLevel readDebugLevel() { static inline DebugLevel readDebugLevel() {
char property[PROPERTY_VALUE_MAX]; char property[PROPERTY_VALUE_MAX];
if (property_get(PROPERTY_DEBUG, property, NULL) > 0) { if (property_get(PROPERTY_DEBUG, property, NULL) > 0) {
return (DebugLevel) atoi(property); return (DebugLevel) atoi(property);

View File

@@ -751,7 +751,6 @@ void RenderNode::issueOperationsOf3dChildren(ChildrenSelectMode mode,
int restoreTo = renderer.save(SkCanvas::kMatrix_SaveFlag); int restoreTo = renderer.save(SkCanvas::kMatrix_SaveFlag);
DrawRenderNodeOp* childOp = zTranslatedNodes[drawIndex].value; DrawRenderNodeOp* childOp = zTranslatedNodes[drawIndex].value;
RenderNode* child = childOp->mRenderNode;
renderer.concatMatrix(childOp->mTransformFromParent); renderer.concatMatrix(childOp->mTransformFromParent);
childOp->mSkipInOrderDraw = false; // this is horrible, I'm so sorry everyone childOp->mSkipInOrderDraw = false; // this is horrible, I'm so sorry everyone
@@ -900,7 +899,7 @@ void RenderNode::issueOperations(OpenGLRenderer& renderer, T& handler) {
initialTransform, zTranslatedNodes, renderer, 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]; DisplayListOp *op = mDisplayListData->displayListOps[opIndex];
#if DEBUG_DISPLAY_LIST #if DEBUG_DISPLAY_LIST
op->output(level + 1); op->output(level + 1);
@@ -908,7 +907,8 @@ void RenderNode::issueOperations(OpenGLRenderer& renderer, T& handler) {
logBuffer.writeCommand(level, op->name()); logBuffer.writeCommand(level, op->name());
handler(op, saveCountOffset, properties().getClipToBounds()); 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); issueOperationsOfProjectedChildren(renderer, handler);
} }
} }

View File

@@ -87,7 +87,6 @@ void ShadowTessellator::tessellateSpotShadow(bool isCasterOpaque,
reverseReceiverTransform.loadInverse(receiverTransform); reverseReceiverTransform.loadInverse(receiverTransform);
reverseReceiverTransform.mapPoint3d(adjustedLightCenter); reverseReceiverTransform.mapPoint3d(adjustedLightCenter);
const int lightVertexCount = 8;
if (CC_UNLIKELY(caches.propertyLightDiameter > 0)) { if (CC_UNLIKELY(caches.propertyLightDiameter > 0)) {
lightRadius = caches.propertyLightDiameter; lightRadius = caches.propertyLightDiameter;
} }

View File

@@ -794,11 +794,15 @@ inline void genNewPenumbraAndPairWithUmbra(const Vector2* penumbra, int penumbra
previousPenumbra * weightForPreviousPenumbra; previousPenumbra * weightForPreviousPenumbra;
int skippedUmbraIndex = (previousClosestUmbraIndex + k + 1) % umbraLength; int skippedUmbraIndex = (previousClosestUmbraIndex + k + 1) % umbraLength;
verticesPair[verticesPairIndex++] = {newPenumbraIndex, skippedUmbraIndex}; verticesPair[verticesPairIndex].outerIndex = newPenumbraIndex;
verticesPair[verticesPairIndex].innerIndex = skippedUmbraIndex;
verticesPairIndex++;
newPenumbra[newPenumbraIndex++] = interpolatedPenumbra; newPenumbra[newPenumbraIndex++] = interpolatedPenumbra;
} }
} }
verticesPair[verticesPairIndex++] = {newPenumbraIndex, currentClosestUmbraIndex}; verticesPair[verticesPairIndex].outerIndex = newPenumbraIndex;
verticesPair[verticesPairIndex].innerIndex = currentClosestUmbraIndex;
verticesPairIndex++;
newPenumbra[newPenumbraIndex++] = currentPenumbraVertex; newPenumbra[newPenumbraIndex++] = currentPenumbraVertex;
previousClosestUmbraIndex = currentClosestUmbraIndex; previousClosestUmbraIndex = currentClosestUmbraIndex;

View File

@@ -378,7 +378,7 @@ void Font::precache(const SkPaint* paint, const char* text, int numGlyphs) {
break; break;
} }
CachedGlyphInfo* cachedGlyph = getCachedGlyph(paint, glyph, true); getCachedGlyph(paint, glyph, true);
glyphsCount++; glyphsCount++;
} }
} }
@@ -403,8 +403,6 @@ void Font::render(const SkPaint* paint, const char* text, uint32_t start, uint32
text += start; text += start;
int glyphsCount = 0; int glyphsCount = 0;
const SkPaint::Align align = paint->getTextAlign();
while (glyphsCount < numGlyphs) { while (glyphsCount < numGlyphs) {
glyph_t glyph = GET_GLYPH(text); glyph_t glyph = GET_GLYPH(text);

View File

@@ -30,9 +30,12 @@
#define DEFAULT_TEXT_LARGE_CACHE_WIDTH 2048 #define DEFAULT_TEXT_LARGE_CACHE_WIDTH 2048
#define DEFAULT_TEXT_LARGE_CACHE_HEIGHT 512 #define DEFAULT_TEXT_LARGE_CACHE_HEIGHT 512
#define TEXTURE_BORDER_SIZE 1 #ifdef TEXTURE_BORDER_SIZE
#if TEXTURE_BORDER_SIZE != 1 #if TEXTURE_BORDER_SIZE != 1
# error TEXTURE_BORDER_SIZE other than 1 is not currently supported #error TEXTURE_BORDER_SIZE other than 1 is not currently supported
#endif
#else
#define TEXTURE_BORDER_SIZE 1
#endif #endif
#define CACHE_BLOCK_ROUNDING_SIZE 4 #define CACHE_BLOCK_ROUNDING_SIZE 4
@@ -44,7 +47,7 @@
#define GET_GLYPH(text) nextGlyph((const uint16_t**) &text) #define GET_GLYPH(text) nextGlyph((const uint16_t**) &text)
#define IS_END_OF_STRING(glyph) false #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; const uint16_t* src = *srcPtr;
glyph_t g = *src++; glyph_t g = *src++;
*srcPtr = src; *srcPtr = src;

View File

@@ -345,8 +345,12 @@ CREATE_BRIDGE0(fence) {
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);
postAndWait(task); postAndWait(task);
} }

View File

@@ -14,6 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
// LOG_TAG is being provided by the Makefile, reset.
#ifdef LOG_TAG
#undef LOG_TAG
#endif
#define LOG_TAG "RenderTask" #define LOG_TAG "RenderTask"
#include "RenderTask.h" #include "RenderTask.h"