Rename native DisplayListRenderer to DisplayListCanvas
Change-Id: I33e6f8cc85da1e7da7ff7bf18d4ebde64222067a
This commit is contained in:
@@ -88,10 +88,10 @@ public class DisplayListCanvas extends Canvas {
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private DisplayListCanvas() {
|
||||
super(nCreateDisplayListRenderer());
|
||||
super(nCreateDisplayListCanvas());
|
||||
}
|
||||
|
||||
private static native long nCreateDisplayListRenderer();
|
||||
private static native long nCreateDisplayListCanvas();
|
||||
|
||||
public static void setProperty(String name, String value) {
|
||||
nSetProperty(name, value);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <SkBitmap.h>
|
||||
#include <SkRegion.h>
|
||||
|
||||
#include <DisplayListRenderer.h>
|
||||
#include <DisplayListCanvas.h>
|
||||
#include <Rect.h>
|
||||
#include <RenderNode.h>
|
||||
#include <CanvasProperty.h>
|
||||
@@ -52,37 +52,37 @@ static struct {
|
||||
|
||||
static void android_view_DisplayListCanvas_setViewport(JNIEnv* env, jobject clazz,
|
||||
jlong rendererPtr, jint width, jint height) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
renderer->setViewport(width, height);
|
||||
}
|
||||
|
||||
static void android_view_DisplayListCanvas_setHighContrastText(JNIEnv* env, jobject clazz,
|
||||
jlong rendererPtr, jboolean highContrastText) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
renderer->setHighContrastText(highContrastText);
|
||||
}
|
||||
|
||||
static void android_view_DisplayListCanvas_insertReorderBarrier(JNIEnv* env, jobject clazz,
|
||||
jlong rendererPtr, jboolean reorderEnable) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
renderer->insertReorderBarrier(reorderEnable);
|
||||
}
|
||||
|
||||
static void android_view_DisplayListCanvas_prepare(JNIEnv* env, jobject clazz,
|
||||
jlong rendererPtr) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
renderer->prepare();
|
||||
}
|
||||
|
||||
static void android_view_DisplayListCanvas_prepareDirty(JNIEnv* env, jobject clazz,
|
||||
jlong rendererPtr, jint left, jint top, jint right, jint bottom) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
renderer->prepareDirty(left, top, right, bottom);
|
||||
}
|
||||
|
||||
static void android_view_DisplayListCanvas_finish(JNIEnv* env, jobject clazz,
|
||||
jlong rendererPtr) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
renderer->finish();
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ static void android_view_DisplayListCanvas_setProperty(JNIEnv* env,
|
||||
|
||||
static void android_view_DisplayListCanvas_callDrawGLFunction(JNIEnv* env, jobject clazz,
|
||||
jlong rendererPtr, jlong functorPtr) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
Functor* functor = reinterpret_cast<Functor*>(functorPtr);
|
||||
android::uirenderer::Rect dirty;
|
||||
renderer->callDrawGLFunction(functor, dirty);
|
||||
@@ -137,7 +137,7 @@ static void android_view_DisplayListCanvas_drawPatch(JNIEnv* env, jobject clazz,
|
||||
float left, float top, float right, float bottom, jlong paintPtr) {
|
||||
SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapPtr);
|
||||
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
Res_png_9patch* patch = reinterpret_cast<Res_png_9patch*>(patchPtr);
|
||||
Paint* paint = reinterpret_cast<Paint*>(paintPtr);
|
||||
renderer->drawPatch(bitmap, patch, left, top, right, bottom, paint);
|
||||
@@ -146,7 +146,7 @@ static void android_view_DisplayListCanvas_drawPatch(JNIEnv* env, jobject clazz,
|
||||
static void android_view_DisplayListCanvas_drawRoundRectProps(JNIEnv* env, jobject clazz,
|
||||
jlong rendererPtr, jlong leftPropPtr, jlong topPropPtr, jlong rightPropPtr,
|
||||
jlong bottomPropPtr, jlong rxPropPtr, jlong ryPropPtr, jlong paintPropPtr) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
CanvasPropertyPrimitive* leftProp = reinterpret_cast<CanvasPropertyPrimitive*>(leftPropPtr);
|
||||
CanvasPropertyPrimitive* topProp = reinterpret_cast<CanvasPropertyPrimitive*>(topPropPtr);
|
||||
CanvasPropertyPrimitive* rightProp = reinterpret_cast<CanvasPropertyPrimitive*>(rightPropPtr);
|
||||
@@ -159,7 +159,7 @@ static void android_view_DisplayListCanvas_drawRoundRectProps(JNIEnv* env, jobje
|
||||
|
||||
static void android_view_DisplayListCanvas_drawCircleProps(JNIEnv* env, jobject clazz,
|
||||
jlong rendererPtr, jlong xPropPtr, jlong yPropPtr, jlong radiusPropPtr, jlong paintPropPtr) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
CanvasPropertyPrimitive* xProp = reinterpret_cast<CanvasPropertyPrimitive*>(xPropPtr);
|
||||
CanvasPropertyPrimitive* yProp = reinterpret_cast<CanvasPropertyPrimitive*>(yPropPtr);
|
||||
CanvasPropertyPrimitive* radiusProp = reinterpret_cast<CanvasPropertyPrimitive*>(radiusPropPtr);
|
||||
@@ -169,7 +169,7 @@ static void android_view_DisplayListCanvas_drawCircleProps(JNIEnv* env, jobject
|
||||
|
||||
static void android_view_DisplayListCanvas_drawRegionAsRects(JNIEnv* env, jobject clazz,
|
||||
jlong rendererPtr, jlong regionPtr, jlong paintPtr) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
SkRegion* region = reinterpret_cast<SkRegion*>(regionPtr);
|
||||
Paint* paint = reinterpret_cast<Paint*>(paintPtr);
|
||||
if (paint->getStyle() != Paint::kFill_Style ||
|
||||
@@ -203,18 +203,18 @@ static void android_view_DisplayListCanvas_drawRegionAsRects(JNIEnv* env, jobjec
|
||||
|
||||
static jlong android_view_DisplayListCanvas_finishRecording(JNIEnv* env,
|
||||
jobject clazz, jlong rendererPtr) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
return reinterpret_cast<jlong>(renderer->finishRecording());
|
||||
}
|
||||
|
||||
static jlong android_view_DisplayListCanvas_createDisplayListRenderer(JNIEnv* env, jobject clazz) {
|
||||
return reinterpret_cast<jlong>(new DisplayListRenderer);
|
||||
static jlong android_view_DisplayListCanvas_createDisplayListCanvas(JNIEnv* env, jobject clazz) {
|
||||
return reinterpret_cast<jlong>(new DisplayListCanvas);
|
||||
}
|
||||
|
||||
static void android_view_DisplayListCanvas_drawRenderNode(JNIEnv* env,
|
||||
jobject clazz, jlong rendererPtr, jlong renderNodePtr,
|
||||
jint flags) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
RenderNode* renderNode = reinterpret_cast<RenderNode*>(renderNodePtr);
|
||||
android::uirenderer::Rect bounds;
|
||||
renderer->drawRenderNode(renderNode, bounds, flags);
|
||||
@@ -226,7 +226,7 @@ static void android_view_DisplayListCanvas_drawRenderNode(JNIEnv* env,
|
||||
|
||||
static void android_view_DisplayListCanvas_drawLayer(JNIEnv* env, jobject clazz,
|
||||
jlong rendererPtr, jlong layerPtr, jfloat x, jfloat y) {
|
||||
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
|
||||
DisplayListCanvas* renderer = reinterpret_cast<DisplayListCanvas*>(rendererPtr);
|
||||
DeferredLayerUpdater* layer = reinterpret_cast<DeferredLayerUpdater*>(layerPtr);
|
||||
renderer->drawLayer(layer, x, y);
|
||||
}
|
||||
@@ -285,7 +285,7 @@ static JNINativeMethod gMethods[] = {
|
||||
{ "nFinishRecording", "(J)J", (void*) android_view_DisplayListCanvas_finishRecording },
|
||||
{ "nDrawRenderNode", "(JJI)V", (void*) android_view_DisplayListCanvas_drawRenderNode },
|
||||
|
||||
{ "nCreateDisplayListRenderer", "()J", (void*) android_view_DisplayListCanvas_createDisplayListRenderer },
|
||||
{ "nCreateDisplayListCanvas", "()J", (void*) android_view_DisplayListCanvas_createDisplayListCanvas },
|
||||
|
||||
{ "nDrawLayer", "(JJFF)V", (void*) android_view_DisplayListCanvas_drawLayer },
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <android_runtime/AndroidRuntime.h>
|
||||
|
||||
#include <Animator.h>
|
||||
#include <DisplayListRenderer.h>
|
||||
#include <RenderNode.h>
|
||||
#include <Paint.h>
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include <ScopedUtfChars.h>
|
||||
|
||||
#include <AnimationContext.h>
|
||||
#include <DisplayListRenderer.h>
|
||||
#include <FrameInfo.h>
|
||||
#include <RenderNode.h>
|
||||
#include <renderthread/RenderProxy.h>
|
||||
|
||||
@@ -37,7 +37,7 @@ LOCAL_SRC_FILES := \
|
||||
DeferredDisplayList.cpp \
|
||||
DeferredLayerUpdater.cpp \
|
||||
DisplayList.cpp \
|
||||
DisplayListRenderer.cpp \
|
||||
DisplayListCanvas.cpp \
|
||||
Dither.cpp \
|
||||
DrawProfiler.cpp \
|
||||
Extensions.cpp \
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "Caches.h"
|
||||
|
||||
#include "DisplayListRenderer.h"
|
||||
#include "GammaFontRenderer.h"
|
||||
#include "LayerRenderer.h"
|
||||
#include "Properties.h"
|
||||
|
||||
@@ -62,12 +62,13 @@ public:
|
||||
* Renderer interface. Drawing and recording classes that include a CanvasState will have
|
||||
* different use cases:
|
||||
*
|
||||
* Drawing subclasses (i.e. OpenGLRenderer) can query attributes (such as transform) or hook into
|
||||
* changes (e.g. save/restore) with minimal surface area for manipulating the stack itself.
|
||||
* Drawing code maintaining canvas state (i.e. OpenGLRenderer) can query attributes (such as
|
||||
* transform) or hook into changes (e.g. save/restore) with minimal surface area for manipulating
|
||||
* the stack itself.
|
||||
*
|
||||
* Recording subclasses (i.e. DisplayListRenderer) can both record and pass through state operations
|
||||
* to CanvasState, so that not only will querying operations work (getClip/Matrix), but so
|
||||
* that quickRejection can also be used.
|
||||
* Recording code maintaining canvas state (i.e. DisplayListCanvas) can both record and pass
|
||||
* through state operations to CanvasState, so that not only will querying operations work
|
||||
* (getClip/Matrix), but so that quickRejection can also be used.
|
||||
*/
|
||||
|
||||
class ANDROID_API CanvasState {
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace uirenderer {
|
||||
|
||||
class DeferredDisplayList;
|
||||
class DisplayListOp;
|
||||
class DisplayListRenderer;
|
||||
class DisplayListCanvas;
|
||||
class OpenGLRenderer;
|
||||
class Rect;
|
||||
class Layer;
|
||||
@@ -109,7 +109,7 @@ struct ReplayStateStruct : public PlaybackStateStruct {
|
||||
* Data structure that holds the list of commands used in display list stream
|
||||
*/
|
||||
class DisplayListData {
|
||||
friend class DisplayListRenderer;
|
||||
friend class DisplayListCanvas;
|
||||
public:
|
||||
struct Chunk {
|
||||
// range of included ops in DLD::displayListOps
|
||||
|
||||
@@ -14,25 +14,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "OpenGLRenderer"
|
||||
#include "DisplayListCanvas.h"
|
||||
|
||||
#include "ResourceCache.h"
|
||||
#include "DeferredDisplayList.h"
|
||||
#include "DeferredLayerUpdater.h"
|
||||
#include "DisplayListOp.h"
|
||||
#include "RenderNode.h"
|
||||
#include "utils/PaintUtils.h"
|
||||
|
||||
#include <SkCamera.h>
|
||||
#include <SkCanvas.h>
|
||||
|
||||
#include <private/hwui/DrawGlInfo.h>
|
||||
|
||||
#include "ResourceCache.h"
|
||||
#include "DeferredDisplayList.h"
|
||||
#include "DeferredLayerUpdater.h"
|
||||
#include "DisplayListOp.h"
|
||||
#include "DisplayListRenderer.h"
|
||||
#include "RenderNode.h"
|
||||
#include "utils/PaintUtils.h"
|
||||
|
||||
namespace android {
|
||||
namespace uirenderer {
|
||||
|
||||
DisplayListRenderer::DisplayListRenderer()
|
||||
DisplayListCanvas::DisplayListCanvas()
|
||||
: mState(*this)
|
||||
, mResourceCache(ResourceCache::getInstance())
|
||||
, mDisplayListData(nullptr)
|
||||
@@ -44,16 +43,16 @@ DisplayListRenderer::DisplayListRenderer()
|
||||
, mRestoreSaveCount(-1) {
|
||||
}
|
||||
|
||||
DisplayListRenderer::~DisplayListRenderer() {
|
||||
DisplayListCanvas::~DisplayListCanvas() {
|
||||
LOG_ALWAYS_FATAL_IF(mDisplayListData,
|
||||
"Destroyed a DisplayListRenderer during a record!");
|
||||
"Destroyed a DisplayListCanvas during a record!");
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Operations
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DisplayListData* DisplayListRenderer::finishRecording() {
|
||||
DisplayListData* DisplayListCanvas::finishRecording() {
|
||||
mPaintMap.clear();
|
||||
mRegionMap.clear();
|
||||
mPathMap.clear();
|
||||
@@ -63,7 +62,7 @@ DisplayListData* DisplayListRenderer::finishRecording() {
|
||||
return data;
|
||||
}
|
||||
|
||||
void DisplayListRenderer::prepareDirty(float left, float top,
|
||||
void DisplayListCanvas::prepareDirty(float left, float top,
|
||||
float right, float bottom) {
|
||||
|
||||
LOG_ALWAYS_FATAL_IF(mDisplayListData,
|
||||
@@ -77,25 +76,25 @@ void DisplayListRenderer::prepareDirty(float left, float top,
|
||||
mRestoreSaveCount = -1;
|
||||
}
|
||||
|
||||
bool DisplayListRenderer::finish() {
|
||||
bool DisplayListCanvas::finish() {
|
||||
flushRestoreToCount();
|
||||
flushTranslate();
|
||||
return false;
|
||||
}
|
||||
|
||||
void DisplayListRenderer::interrupt() {
|
||||
void DisplayListCanvas::interrupt() {
|
||||
}
|
||||
|
||||
void DisplayListRenderer::resume() {
|
||||
void DisplayListCanvas::resume() {
|
||||
}
|
||||
|
||||
void DisplayListRenderer::callDrawGLFunction(Functor *functor, Rect& dirty) {
|
||||
void DisplayListCanvas::callDrawGLFunction(Functor *functor, Rect& dirty) {
|
||||
// Ignore dirty during recording, it matters only when we replay
|
||||
addDrawOp(new (alloc()) DrawFunctorOp(functor));
|
||||
mDisplayListData->functors.add(functor);
|
||||
}
|
||||
|
||||
SkCanvas* DisplayListRenderer::asSkCanvas() {
|
||||
SkCanvas* DisplayListCanvas::asSkCanvas() {
|
||||
LOG_ALWAYS_FATAL_IF(!mDisplayListData,
|
||||
"attempting to get an SkCanvas when we are not recording!");
|
||||
if (!mSkiaCanvasProxy) {
|
||||
@@ -104,12 +103,12 @@ SkCanvas* DisplayListRenderer::asSkCanvas() {
|
||||
return mSkiaCanvasProxy.get();
|
||||
}
|
||||
|
||||
int DisplayListRenderer::save(SkCanvas::SaveFlags flags) {
|
||||
int DisplayListCanvas::save(SkCanvas::SaveFlags flags) {
|
||||
addStateOp(new (alloc()) SaveOp((int) flags));
|
||||
return mState.save((int) flags);
|
||||
}
|
||||
|
||||
void DisplayListRenderer::restore() {
|
||||
void DisplayListCanvas::restore() {
|
||||
if (mRestoreSaveCount < 0) {
|
||||
restoreToCount(getSaveCount() - 1);
|
||||
return;
|
||||
@@ -120,13 +119,13 @@ void DisplayListRenderer::restore() {
|
||||
mState.restore();
|
||||
}
|
||||
|
||||
void DisplayListRenderer::restoreToCount(int saveCount) {
|
||||
void DisplayListCanvas::restoreToCount(int saveCount) {
|
||||
mRestoreSaveCount = saveCount;
|
||||
flushTranslate();
|
||||
mState.restoreToCount(saveCount);
|
||||
}
|
||||
|
||||
int DisplayListRenderer::saveLayer(float left, float top, float right, float bottom,
|
||||
int DisplayListCanvas::saveLayer(float left, float top, float right, float bottom,
|
||||
const SkPaint* paint, SkCanvas::SaveFlags flags) {
|
||||
// force matrix/clip isolation for layer
|
||||
flags |= SkCanvas::kClip_SaveFlag | SkCanvas::kMatrix_SaveFlag;
|
||||
@@ -136,7 +135,7 @@ int DisplayListRenderer::saveLayer(float left, float top, float right, float bot
|
||||
return mState.save((int) flags);
|
||||
}
|
||||
|
||||
void DisplayListRenderer::translate(float dx, float dy) {
|
||||
void DisplayListCanvas::translate(float dx, float dy) {
|
||||
mHasDeferredTranslate = true;
|
||||
mTranslateX += dx;
|
||||
mTranslateY += dy;
|
||||
@@ -144,66 +143,66 @@ void DisplayListRenderer::translate(float dx, float dy) {
|
||||
mState.translate(dx, dy, 0.0f);
|
||||
}
|
||||
|
||||
void DisplayListRenderer::rotate(float degrees) {
|
||||
void DisplayListCanvas::rotate(float degrees) {
|
||||
addStateOp(new (alloc()) RotateOp(degrees));
|
||||
mState.rotate(degrees);
|
||||
}
|
||||
|
||||
void DisplayListRenderer::scale(float sx, float sy) {
|
||||
void DisplayListCanvas::scale(float sx, float sy) {
|
||||
addStateOp(new (alloc()) ScaleOp(sx, sy));
|
||||
mState.scale(sx, sy);
|
||||
}
|
||||
|
||||
void DisplayListRenderer::skew(float sx, float sy) {
|
||||
void DisplayListCanvas::skew(float sx, float sy) {
|
||||
addStateOp(new (alloc()) SkewOp(sx, sy));
|
||||
mState.skew(sx, sy);
|
||||
}
|
||||
|
||||
void DisplayListRenderer::setMatrix(const SkMatrix& matrix) {
|
||||
void DisplayListCanvas::setMatrix(const SkMatrix& matrix) {
|
||||
addStateOp(new (alloc()) SetMatrixOp(matrix));
|
||||
mState.setMatrix(matrix);
|
||||
}
|
||||
|
||||
void DisplayListRenderer::concat(const SkMatrix& matrix) {
|
||||
void DisplayListCanvas::concat(const SkMatrix& matrix) {
|
||||
addStateOp(new (alloc()) ConcatMatrixOp(matrix));
|
||||
mState.concatMatrix(matrix);
|
||||
}
|
||||
|
||||
bool DisplayListRenderer::getClipBounds(SkRect* outRect) const {
|
||||
bool DisplayListCanvas::getClipBounds(SkRect* outRect) const {
|
||||
Rect bounds = mState.getLocalClipBounds();
|
||||
*outRect = SkRect::MakeLTRB(bounds.left, bounds.top, bounds.right, bounds.bottom);
|
||||
return !(outRect->isEmpty());
|
||||
}
|
||||
|
||||
bool DisplayListRenderer::quickRejectRect(float left, float top, float right, float bottom) const {
|
||||
bool DisplayListCanvas::quickRejectRect(float left, float top, float right, float bottom) const {
|
||||
return mState.quickRejectConservative(left, top, right, bottom);
|
||||
}
|
||||
|
||||
bool DisplayListRenderer::quickRejectPath(const SkPath& path) const {
|
||||
bool DisplayListCanvas::quickRejectPath(const SkPath& path) const {
|
||||
SkRect bounds = path.getBounds();
|
||||
return mState.quickRejectConservative(bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom);
|
||||
}
|
||||
|
||||
|
||||
bool DisplayListRenderer::clipRect(float left, float top, float right, float bottom,
|
||||
bool DisplayListCanvas::clipRect(float left, float top, float right, float bottom,
|
||||
SkRegion::Op op) {
|
||||
addStateOp(new (alloc()) ClipRectOp(left, top, right, bottom, op));
|
||||
return mState.clipRect(left, top, right, bottom, op);
|
||||
}
|
||||
|
||||
bool DisplayListRenderer::clipPath(const SkPath* path, SkRegion::Op op) {
|
||||
bool DisplayListCanvas::clipPath(const SkPath* path, SkRegion::Op op) {
|
||||
path = refPath(path);
|
||||
addStateOp(new (alloc()) ClipPathOp(path, op));
|
||||
return mState.clipPath(path, op);
|
||||
}
|
||||
|
||||
bool DisplayListRenderer::clipRegion(const SkRegion* region, SkRegion::Op op) {
|
||||
bool DisplayListCanvas::clipRegion(const SkRegion* region, SkRegion::Op op) {
|
||||
region = refRegion(region);
|
||||
addStateOp(new (alloc()) ClipRegionOp(region, op));
|
||||
return mState.clipRegion(region, op);
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawRenderNode(RenderNode* renderNode, Rect& dirty, int32_t flags) {
|
||||
void DisplayListCanvas::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,
|
||||
@@ -212,21 +211,21 @@ void DisplayListRenderer::drawRenderNode(RenderNode* renderNode, Rect& dirty, in
|
||||
addRenderNodeOp(op);
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawLayer(DeferredLayerUpdater* layerHandle, float x, float y) {
|
||||
void DisplayListCanvas::drawLayer(DeferredLayerUpdater* layerHandle, float x, float y) {
|
||||
// We ref the DeferredLayerUpdater due to its thread-safe ref-counting
|
||||
// semantics.
|
||||
mDisplayListData->ref(layerHandle);
|
||||
addDrawOp(new (alloc()) DrawLayerOp(layerHandle->backingLayer(), x, y));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawBitmap(const SkBitmap* bitmap, const SkPaint* paint) {
|
||||
void DisplayListCanvas::drawBitmap(const SkBitmap* bitmap, const SkPaint* paint) {
|
||||
bitmap = refBitmap(bitmap);
|
||||
paint = refPaint(paint);
|
||||
|
||||
addDrawOp(new (alloc()) DrawBitmapOp(bitmap, paint));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawBitmap(const SkBitmap& bitmap, float left, float top,
|
||||
void DisplayListCanvas::drawBitmap(const SkBitmap& bitmap, float left, float top,
|
||||
const SkPaint* paint) {
|
||||
save(SkCanvas::kMatrix_SaveFlag);
|
||||
translate(left, top);
|
||||
@@ -234,7 +233,7 @@ void DisplayListRenderer::drawBitmap(const SkBitmap& bitmap, float left, float t
|
||||
restore();
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawBitmap(const SkBitmap& bitmap, const SkMatrix& matrix,
|
||||
void DisplayListCanvas::drawBitmap(const SkBitmap& bitmap, const SkMatrix& matrix,
|
||||
const SkPaint* paint) {
|
||||
if (matrix.isIdentity()) {
|
||||
drawBitmap(&bitmap, paint);
|
||||
@@ -254,7 +253,7 @@ void DisplayListRenderer::drawBitmap(const SkBitmap& bitmap, const SkMatrix& mat
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawBitmap(const SkBitmap& bitmap, float srcLeft, float srcTop,
|
||||
void DisplayListCanvas::drawBitmap(const SkBitmap& bitmap, float srcLeft, float srcTop,
|
||||
float srcRight, float srcBottom, float dstLeft, float dstTop,
|
||||
float dstRight, float dstBottom, const SkPaint* paint) {
|
||||
if (srcLeft == 0 && srcTop == 0
|
||||
@@ -300,7 +299,7 @@ void DisplayListRenderer::drawBitmap(const SkBitmap& bitmap, float srcLeft, floa
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawBitmapMesh(const SkBitmap& bitmap, int meshWidth, int meshHeight,
|
||||
void DisplayListCanvas::drawBitmapMesh(const SkBitmap& bitmap, int meshWidth, int meshHeight,
|
||||
const float* vertices, const int* colors, const SkPaint* paint) {
|
||||
int vertexCount = (meshWidth + 1) * (meshHeight + 1);
|
||||
vertices = refBuffer<float>(vertices, vertexCount * 2); // 2 floats per vertex
|
||||
@@ -311,7 +310,7 @@ void DisplayListRenderer::drawBitmapMesh(const SkBitmap& bitmap, int meshWidth,
|
||||
vertices, colors, paint));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawPatch(const SkBitmap* bitmap, const Res_png_9patch* patch,
|
||||
void DisplayListCanvas::drawPatch(const SkBitmap* bitmap, const Res_png_9patch* patch,
|
||||
float left, float top, float right, float bottom, const SkPaint* paint) {
|
||||
bitmap = refBitmap(bitmap);
|
||||
patch = refPatch(patch);
|
||||
@@ -320,11 +319,11 @@ void DisplayListRenderer::drawPatch(const SkBitmap* bitmap, const Res_png_9patch
|
||||
addDrawOp(new (alloc()) DrawPatchOp(bitmap, patch, left, top, right, bottom, paint));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawColor(int color, SkXfermode::Mode mode) {
|
||||
void DisplayListCanvas::drawColor(int color, SkXfermode::Mode mode) {
|
||||
addDrawOp(new (alloc()) DrawColorOp(color, mode));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawPaint(const SkPaint& paint) {
|
||||
void DisplayListCanvas::drawPaint(const SkPaint& paint) {
|
||||
SkRect bounds;
|
||||
if (getClipBounds(&bounds)) {
|
||||
drawRect(bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom, paint);
|
||||
@@ -332,17 +331,17 @@ void DisplayListRenderer::drawPaint(const SkPaint& paint) {
|
||||
}
|
||||
|
||||
|
||||
void DisplayListRenderer::drawRect(float left, float top, float right, float bottom,
|
||||
void DisplayListCanvas::drawRect(float left, float top, float right, float bottom,
|
||||
const SkPaint& paint) {
|
||||
addDrawOp(new (alloc()) DrawRectOp(left, top, right, bottom, refPaint(&paint)));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawRoundRect(float left, float top, float right, float bottom,
|
||||
void DisplayListCanvas::drawRoundRect(float left, float top, float right, float bottom,
|
||||
float rx, float ry, const SkPaint& paint) {
|
||||
addDrawOp(new (alloc()) DrawRoundRectOp(left, top, right, bottom, rx, ry, refPaint(&paint)));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawRoundRect(
|
||||
void DisplayListCanvas::drawRoundRect(
|
||||
CanvasPropertyPrimitive* left, CanvasPropertyPrimitive* top,
|
||||
CanvasPropertyPrimitive* right, CanvasPropertyPrimitive* bottom,
|
||||
CanvasPropertyPrimitive* rx, CanvasPropertyPrimitive* ry,
|
||||
@@ -358,11 +357,11 @@ void DisplayListRenderer::drawRoundRect(
|
||||
&right->value, &bottom->value, &rx->value, &ry->value, &paint->value));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawCircle(float x, float y, float radius, const SkPaint& paint) {
|
||||
void DisplayListCanvas::drawCircle(float x, float y, float radius, const SkPaint& paint) {
|
||||
addDrawOp(new (alloc()) DrawCircleOp(x, y, radius, refPaint(&paint)));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawCircle(CanvasPropertyPrimitive* x, CanvasPropertyPrimitive* y,
|
||||
void DisplayListCanvas::drawCircle(CanvasPropertyPrimitive* x, CanvasPropertyPrimitive* y,
|
||||
CanvasPropertyPrimitive* radius, CanvasPropertyPaint* paint) {
|
||||
mDisplayListData->ref(x);
|
||||
mDisplayListData->ref(y);
|
||||
@@ -372,12 +371,12 @@ void DisplayListRenderer::drawCircle(CanvasPropertyPrimitive* x, CanvasPropertyP
|
||||
&radius->value, &paint->value));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawOval(float left, float top, float right, float bottom,
|
||||
void DisplayListCanvas::drawOval(float left, float top, float right, float bottom,
|
||||
const SkPaint& paint) {
|
||||
addDrawOp(new (alloc()) DrawOvalOp(left, top, right, bottom, refPaint(&paint)));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawArc(float left, float top, float right, float bottom,
|
||||
void DisplayListCanvas::drawArc(float left, float top, float right, float bottom,
|
||||
float startAngle, float sweepAngle, bool useCenter, const SkPaint& paint) {
|
||||
if (fabs(sweepAngle) >= 360.0f) {
|
||||
drawOval(left, top, right, bottom, paint);
|
||||
@@ -387,23 +386,23 @@ void DisplayListRenderer::drawArc(float left, float top, float right, float bott
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawPath(const SkPath& path, const SkPaint& paint) {
|
||||
void DisplayListCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
|
||||
addDrawOp(new (alloc()) DrawPathOp(refPath(&path), refPaint(&paint)));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawLines(const float* points, int count, const SkPaint& paint) {
|
||||
void DisplayListCanvas::drawLines(const float* points, int count, const SkPaint& paint) {
|
||||
points = refBuffer<float>(points, count);
|
||||
|
||||
addDrawOp(new (alloc()) DrawLinesOp(points, count, refPaint(&paint)));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawPoints(const float* points, int count, const SkPaint& paint) {
|
||||
void DisplayListCanvas::drawPoints(const float* points, int count, const SkPaint& paint) {
|
||||
points = refBuffer<float>(points, count);
|
||||
|
||||
addDrawOp(new (alloc()) DrawPointsOp(points, count, refPaint(&paint)));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawTextOnPath(const uint16_t* glyphs, int count,
|
||||
void DisplayListCanvas::drawTextOnPath(const uint16_t* glyphs, int count,
|
||||
const SkPath& path, float hOffset, float vOffset, const SkPaint& paint) {
|
||||
if (!glyphs || count <= 0) return;
|
||||
|
||||
@@ -414,7 +413,7 @@ void DisplayListRenderer::drawTextOnPath(const uint16_t* glyphs, int count,
|
||||
addDrawOp(op);
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawPosText(const uint16_t* text, const float* positions,
|
||||
void DisplayListCanvas::drawPosText(const uint16_t* text, const float* positions,
|
||||
int count, int posCount, const SkPaint& paint) {
|
||||
if (!text || count <= 0) return;
|
||||
|
||||
@@ -436,7 +435,7 @@ static void simplifyPaint(int color, SkPaint* paint) {
|
||||
paint->setLooper(nullptr);
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawText(const uint16_t* glyphs, const float* positions,
|
||||
void DisplayListCanvas::drawText(const uint16_t* glyphs, const float* positions,
|
||||
int count, const SkPaint& paint, float x, float y,
|
||||
float boundsLeft, float boundsTop, float boundsRight, float boundsBottom,
|
||||
float totalAdvance) {
|
||||
@@ -475,7 +474,7 @@ void DisplayListRenderer::drawText(const uint16_t* glyphs, const float* position
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayListRenderer::drawRects(const float* rects, int count, const SkPaint* paint) {
|
||||
void DisplayListCanvas::drawRects(const float* rects, int count, const SkPaint* paint) {
|
||||
if (count <= 0) return;
|
||||
|
||||
rects = refBuffer<float>(rects, count);
|
||||
@@ -483,24 +482,24 @@ void DisplayListRenderer::drawRects(const float* rects, int count, const SkPaint
|
||||
addDrawOp(new (alloc()) DrawRectsOp(rects, count, paint));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::setDrawFilter(SkDrawFilter* filter) {
|
||||
void DisplayListCanvas::setDrawFilter(SkDrawFilter* filter) {
|
||||
mDrawFilter.reset(SkSafeRef(filter));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::insertReorderBarrier(bool enableReorder) {
|
||||
void DisplayListCanvas::insertReorderBarrier(bool enableReorder) {
|
||||
flushRestoreToCount();
|
||||
flushTranslate();
|
||||
mDeferredBarrierType = enableReorder ? kBarrier_OutOfOrder : kBarrier_InOrder;
|
||||
}
|
||||
|
||||
void DisplayListRenderer::flushRestoreToCount() {
|
||||
void DisplayListCanvas::flushRestoreToCount() {
|
||||
if (mRestoreSaveCount >= 0) {
|
||||
addOpAndUpdateChunk(new (alloc()) RestoreToCountOp(mRestoreSaveCount));
|
||||
mRestoreSaveCount = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayListRenderer::flushTranslate() {
|
||||
void DisplayListCanvas::flushTranslate() {
|
||||
if (mHasDeferredTranslate) {
|
||||
if (mTranslateX != 0.0f || mTranslateY != 0.0f) {
|
||||
addOpAndUpdateChunk(new (alloc()) TranslateOp(mTranslateX, mTranslateY));
|
||||
@@ -510,7 +509,7 @@ void DisplayListRenderer::flushTranslate() {
|
||||
}
|
||||
}
|
||||
|
||||
size_t DisplayListRenderer::addOpAndUpdateChunk(DisplayListOp* op) {
|
||||
size_t DisplayListCanvas::addOpAndUpdateChunk(DisplayListOp* op) {
|
||||
int insertIndex = mDisplayListData->displayListOps.add(op);
|
||||
if (mDeferredBarrierType != kBarrier_None) {
|
||||
// op is first in new chunk
|
||||
@@ -530,17 +529,17 @@ size_t DisplayListRenderer::addOpAndUpdateChunk(DisplayListOp* op) {
|
||||
return insertIndex;
|
||||
}
|
||||
|
||||
size_t DisplayListRenderer::flushAndAddOp(DisplayListOp* op) {
|
||||
size_t DisplayListCanvas::flushAndAddOp(DisplayListOp* op) {
|
||||
flushRestoreToCount();
|
||||
flushTranslate();
|
||||
return addOpAndUpdateChunk(op);
|
||||
}
|
||||
|
||||
size_t DisplayListRenderer::addStateOp(StateOp* op) {
|
||||
size_t DisplayListCanvas::addStateOp(StateOp* op) {
|
||||
return flushAndAddOp(op);
|
||||
}
|
||||
|
||||
size_t DisplayListRenderer::addDrawOp(DrawOp* op) {
|
||||
size_t DisplayListCanvas::addDrawOp(DrawOp* op) {
|
||||
Rect localBounds;
|
||||
if (op->getLocalBounds(localBounds)) {
|
||||
bool rejected = quickRejectRect(localBounds.left, localBounds.top,
|
||||
@@ -552,7 +551,7 @@ size_t DisplayListRenderer::addDrawOp(DrawOp* op) {
|
||||
return flushAndAddOp(op);
|
||||
}
|
||||
|
||||
size_t DisplayListRenderer::addRenderNodeOp(DrawRenderNodeOp* op) {
|
||||
size_t DisplayListCanvas::addRenderNodeOp(DrawRenderNodeOp* op) {
|
||||
int opIndex = addDrawOp(op);
|
||||
int childIndex = mDisplayListData->addChild(op);
|
||||
|
||||
@@ -52,9 +52,7 @@ namespace uirenderer {
|
||||
|
||||
class DeferredDisplayList;
|
||||
class DeferredLayerUpdater;
|
||||
class DisplayListRenderer;
|
||||
class DisplayListOp;
|
||||
class DisplayListRenderer;
|
||||
class DrawOp;
|
||||
class RenderNode;
|
||||
class StateOp;
|
||||
@@ -62,10 +60,10 @@ class StateOp;
|
||||
/**
|
||||
* Records drawing commands in a display list for later playback into an OpenGLRenderer.
|
||||
*/
|
||||
class ANDROID_API DisplayListRenderer: public Canvas, public CanvasStateClient {
|
||||
class ANDROID_API DisplayListCanvas: public Canvas, public CanvasStateClient {
|
||||
public:
|
||||
DisplayListRenderer();
|
||||
virtual ~DisplayListRenderer();
|
||||
DisplayListCanvas();
|
||||
virtual ~DisplayListCanvas();
|
||||
|
||||
void insertReorderBarrier(bool enableReorder);
|
||||
|
||||
@@ -139,7 +137,7 @@ public:
|
||||
virtual SkCanvas* asSkCanvas() override;
|
||||
|
||||
virtual void setBitmap(SkBitmap* bitmap, bool copyState) override {
|
||||
LOG_ALWAYS_FATAL("DisplayListRenderer is not backed by a bitmap.");
|
||||
LOG_ALWAYS_FATAL("DisplayListCanvas is not backed by a bitmap.");
|
||||
}
|
||||
|
||||
virtual bool isOpaque() override { return false; }
|
||||
@@ -216,7 +214,7 @@ public:
|
||||
virtual void drawVertices(SkCanvas::VertexMode vertexMode, int vertexCount,
|
||||
const float* verts, const float* tex, const int* colors,
|
||||
const uint16_t* indices, int indexCount, const SkPaint& paint) override
|
||||
{ /* DisplayListRenderer does not support drawVertices(); ignore */ }
|
||||
{ /* DisplayListCanvas does not support drawVertices(); ignore */ }
|
||||
|
||||
// Bitmap-based
|
||||
virtual void drawBitmap(const SkBitmap& bitmap, float left, float top, const SkPaint* paint) override;
|
||||
@@ -382,7 +380,7 @@ private:
|
||||
|
||||
friend class RenderNode;
|
||||
|
||||
}; // class DisplayListRenderer
|
||||
}; // class DisplayListCanvas
|
||||
|
||||
}; // namespace uirenderer
|
||||
}; // namespace android
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "OpenGLRenderer.h"
|
||||
#include "AssetAtlas.h"
|
||||
#include "DeferredDisplayList.h"
|
||||
#include "DisplayListRenderer.h"
|
||||
#include "DisplayListCanvas.h"
|
||||
#include "GammaFontRenderer.h"
|
||||
#include "Patch.h"
|
||||
#include "RenderNode.h"
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "OpenGLRenderer.h"
|
||||
|
||||
#include "DeferredDisplayList.h"
|
||||
#include "DisplayListRenderer.h"
|
||||
#include "GammaFontRenderer.h"
|
||||
#include "Glop.h"
|
||||
#include "GlopBuilder.h"
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace android {
|
||||
namespace uirenderer {
|
||||
|
||||
class DisplayListOp;
|
||||
class DisplayListRenderer;
|
||||
class DisplayListCanvas;
|
||||
class OpenGLRenderer;
|
||||
class Rect;
|
||||
class Layer;
|
||||
@@ -64,7 +64,7 @@ class TreeInfo;
|
||||
* Primary class for storing recorded canvas commands, as well as per-View/ViewGroup display properties.
|
||||
*
|
||||
* Recording of canvas commands is somewhat similar to SkPicture, except the canvas-recording
|
||||
* functionality is split between DisplayListRenderer (which manages the recording), DisplayListData
|
||||
* functionality is split between DisplayListCanvas (which manages the recording), DisplayListData
|
||||
* (which holds the actual data), and DisplayList (which holds properties and performs playback onto
|
||||
* a renderer).
|
||||
*
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <ui/PixelFormat.h>
|
||||
|
||||
#include <AnimationContext.h>
|
||||
#include <DisplayListRenderer.h>
|
||||
#include <DisplayListCanvas.h>
|
||||
#include <RenderNode.h>
|
||||
#include <renderthread/RenderProxy.h>
|
||||
#include <renderthread/RenderTask.h>
|
||||
@@ -40,15 +40,15 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
static DisplayListRenderer* startRecording(RenderNode* node) {
|
||||
DisplayListRenderer* renderer = new DisplayListRenderer();
|
||||
static DisplayListCanvas* startRecording(RenderNode* node) {
|
||||
DisplayListCanvas* renderer = new DisplayListCanvas();
|
||||
renderer->setViewport(node->stagingProperties().getWidth(),
|
||||
node->stagingProperties().getHeight());
|
||||
renderer->prepare();
|
||||
return renderer;
|
||||
}
|
||||
|
||||
static void endRecording(DisplayListRenderer* renderer, RenderNode* node) {
|
||||
static void endRecording(DisplayListCanvas* renderer, RenderNode* node) {
|
||||
renderer->finish();
|
||||
node->setStagingDisplayList(renderer->finishRecording());
|
||||
delete renderer;
|
||||
@@ -58,7 +58,7 @@ class TreeContentAnimation {
|
||||
public:
|
||||
virtual ~TreeContentAnimation() {}
|
||||
virtual int getFrameCount() { return 150; }
|
||||
virtual void createContent(int width, int height, DisplayListRenderer* renderer) = 0;
|
||||
virtual void createContent(int width, int height, DisplayListCanvas* renderer) = 0;
|
||||
virtual void doFrame(int frameNr) = 0;
|
||||
|
||||
template <class T>
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
|
||||
android::uirenderer::Rect DUMMY;
|
||||
|
||||
DisplayListRenderer* renderer = startRecording(rootNode);
|
||||
DisplayListCanvas* renderer = startRecording(rootNode);
|
||||
animation.createContent(width, height, renderer);
|
||||
endRecording(renderer, rootNode);
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
class ShadowGridAnimation : public TreeContentAnimation {
|
||||
public:
|
||||
std::vector< sp<RenderNode> > cards;
|
||||
void createContent(int width, int height, DisplayListRenderer* renderer) override {
|
||||
void createContent(int width, int height, DisplayListCanvas* renderer) override {
|
||||
android::uirenderer::Rect DUMMY;
|
||||
|
||||
renderer->drawColor(0xFFFFFFFF, SkXfermode::kSrcOver_Mode);
|
||||
@@ -142,7 +142,7 @@ private:
|
||||
node->mutateStagingProperties().mutableOutline().setShouldClip(true);
|
||||
node->setPropertyFieldsDirty(RenderNode::X | RenderNode::Y | RenderNode::Z);
|
||||
|
||||
DisplayListRenderer* renderer = startRecording(node.get());
|
||||
DisplayListCanvas* renderer = startRecording(node.get());
|
||||
renderer->drawColor(0xFFEEEEEE, SkXfermode::kSrcOver_Mode);
|
||||
endRecording(renderer, node.get());
|
||||
return node;
|
||||
@@ -152,7 +152,7 @@ private:
|
||||
class RectGridAnimation : public TreeContentAnimation {
|
||||
public:
|
||||
sp<RenderNode> card;
|
||||
void createContent(int width, int height, DisplayListRenderer* renderer) override {
|
||||
void createContent(int width, int height, DisplayListCanvas* renderer) override {
|
||||
android::uirenderer::Rect DUMMY;
|
||||
|
||||
renderer->drawColor(0xFFFFFFFF, SkXfermode::kSrcOver_Mode);
|
||||
@@ -174,7 +174,7 @@ private:
|
||||
node->mutateStagingProperties().setLeftTopRightBottom(x, y, x + width, y + height);
|
||||
node->setPropertyFieldsDirty(RenderNode::X | RenderNode::Y);
|
||||
|
||||
DisplayListRenderer* renderer = startRecording(node.get());
|
||||
DisplayListCanvas* renderer = startRecording(node.get());
|
||||
renderer->drawColor(0xFFFF00FF, SkXfermode::kSrcOver_Mode);
|
||||
|
||||
float rects[width * height];
|
||||
@@ -201,7 +201,7 @@ private:
|
||||
class OvalAnimation : public TreeContentAnimation {
|
||||
public:
|
||||
sp<RenderNode> card;
|
||||
void createContent(int width, int height, DisplayListRenderer* renderer) override {
|
||||
void createContent(int width, int height, DisplayListCanvas* renderer) override {
|
||||
android::uirenderer::Rect DUMMY;
|
||||
|
||||
renderer->drawColor(0xFFFFFFFF, SkXfermode::kSrcOver_Mode);
|
||||
@@ -224,7 +224,7 @@ private:
|
||||
node->mutateStagingProperties().setLeftTopRightBottom(x, y, x + width, y + height);
|
||||
node->setPropertyFieldsDirty(RenderNode::X | RenderNode::Y);
|
||||
|
||||
DisplayListRenderer* renderer = startRecording(node.get());
|
||||
DisplayListCanvas* renderer = startRecording(node.get());
|
||||
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
Reference in New Issue
Block a user