DisplayListCanvas.cpp revision 772687d24206e2fa2deebf0980a932573a624b17
1/* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#include "DisplayListCanvas.h" 18 19#include "ResourceCache.h" 20#include "DeferredDisplayList.h" 21#include "DeferredLayerUpdater.h" 22#include "DisplayListOp.h" 23#include "RenderNode.h" 24#include "utils/PaintUtils.h" 25 26#include <SkCamera.h> 27#include <SkCanvas.h> 28 29#include <private/hwui/DrawGlInfo.h> 30 31namespace android { 32namespace uirenderer { 33 34DisplayListCanvas::DisplayListCanvas() 35 : mState(*this) 36 , mResourceCache(ResourceCache::getInstance()) 37 , mDisplayListData(nullptr) 38 , mTranslateX(0.0f) 39 , mTranslateY(0.0f) 40 , mHasDeferredTranslate(false) 41 , mDeferredBarrierType(kBarrier_None) 42 , mHighContrastText(false) 43 , mRestoreSaveCount(-1) { 44} 45 46DisplayListCanvas::~DisplayListCanvas() { 47 LOG_ALWAYS_FATAL_IF(mDisplayListData, 48 "Destroyed a DisplayListCanvas during a record!"); 49} 50 51/////////////////////////////////////////////////////////////////////////////// 52// Operations 53/////////////////////////////////////////////////////////////////////////////// 54 55DisplayListData* DisplayListCanvas::finishRecording() { 56 mPaintMap.clear(); 57 mRegionMap.clear(); 58 mPathMap.clear(); 59 DisplayListData* data = mDisplayListData; 60 mDisplayListData = nullptr; 61 mSkiaCanvasProxy.reset(nullptr); 62 return data; 63} 64 65void DisplayListCanvas::prepareDirty(float left, float top, 66 float right, float bottom) { 67 68 LOG_ALWAYS_FATAL_IF(mDisplayListData, 69 "prepareDirty called a second time during a recording!"); 70 mDisplayListData = new DisplayListData(); 71 72 mState.initializeSaveStack(0, 0, mState.getWidth(), mState.getHeight(), Vector3()); 73 74 mDeferredBarrierType = kBarrier_InOrder; 75 mState.setDirtyClip(false); 76 mRestoreSaveCount = -1; 77} 78 79bool DisplayListCanvas::finish() { 80 flushRestoreToCount(); 81 flushTranslate(); 82 return false; 83} 84 85void DisplayListCanvas::interrupt() { 86} 87 88void DisplayListCanvas::resume() { 89} 90 91void DisplayListCanvas::callDrawGLFunction(Functor *functor) { 92 addDrawOp(new (alloc()) DrawFunctorOp(functor)); 93 mDisplayListData->functors.add(functor); 94} 95 96SkCanvas* DisplayListCanvas::asSkCanvas() { 97 LOG_ALWAYS_FATAL_IF(!mDisplayListData, 98 "attempting to get an SkCanvas when we are not recording!"); 99 if (!mSkiaCanvasProxy) { 100 mSkiaCanvasProxy.reset(new SkiaCanvasProxy(this)); 101 } 102 return mSkiaCanvasProxy.get(); 103} 104 105int DisplayListCanvas::save(SkCanvas::SaveFlags flags) { 106 addStateOp(new (alloc()) SaveOp((int) flags)); 107 return mState.save((int) flags); 108} 109 110void DisplayListCanvas::restore() { 111 if (mRestoreSaveCount < 0) { 112 restoreToCount(getSaveCount() - 1); 113 return; 114 } 115 116 mRestoreSaveCount--; 117 flushTranslate(); 118 mState.restore(); 119} 120 121void DisplayListCanvas::restoreToCount(int saveCount) { 122 mRestoreSaveCount = saveCount; 123 flushTranslate(); 124 mState.restoreToCount(saveCount); 125} 126 127int DisplayListCanvas::saveLayer(float left, float top, float right, float bottom, 128 const SkPaint* paint, SkCanvas::SaveFlags flags) { 129 // force matrix/clip isolation for layer 130 flags |= SkCanvas::kClip_SaveFlag | SkCanvas::kMatrix_SaveFlag; 131 132 paint = refPaint(paint); 133 addStateOp(new (alloc()) SaveLayerOp(left, top, right, bottom, paint, (int) flags)); 134 return mState.save((int) flags); 135} 136 137void DisplayListCanvas::translate(float dx, float dy) { 138 if (dx == 0.0f && dy == 0.0f) return; 139 140 mHasDeferredTranslate = true; 141 mTranslateX += dx; 142 mTranslateY += dy; 143 flushRestoreToCount(); 144 mState.translate(dx, dy, 0.0f); 145} 146 147void DisplayListCanvas::rotate(float degrees) { 148 if (degrees == 0.0f) return; 149 150 addStateOp(new (alloc()) RotateOp(degrees)); 151 mState.rotate(degrees); 152} 153 154void DisplayListCanvas::scale(float sx, float sy) { 155 if (sx == 1.0f && sy == 1.0f) return; 156 157 addStateOp(new (alloc()) ScaleOp(sx, sy)); 158 mState.scale(sx, sy); 159} 160 161void DisplayListCanvas::skew(float sx, float sy) { 162 addStateOp(new (alloc()) SkewOp(sx, sy)); 163 mState.skew(sx, sy); 164} 165 166void DisplayListCanvas::setMatrix(const SkMatrix& matrix) { 167 addStateOp(new (alloc()) SetMatrixOp(matrix)); 168 mState.setMatrix(matrix); 169} 170 171void DisplayListCanvas::concat(const SkMatrix& matrix) { 172 addStateOp(new (alloc()) ConcatMatrixOp(matrix)); 173 mState.concatMatrix(matrix); 174} 175 176bool DisplayListCanvas::getClipBounds(SkRect* outRect) const { 177 Rect bounds = mState.getLocalClipBounds(); 178 *outRect = SkRect::MakeLTRB(bounds.left, bounds.top, bounds.right, bounds.bottom); 179 return !(outRect->isEmpty()); 180} 181 182bool DisplayListCanvas::quickRejectRect(float left, float top, float right, float bottom) const { 183 return mState.quickRejectConservative(left, top, right, bottom); 184} 185 186bool DisplayListCanvas::quickRejectPath(const SkPath& path) const { 187 SkRect bounds = path.getBounds(); 188 return mState.quickRejectConservative(bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom); 189} 190 191 192bool DisplayListCanvas::clipRect(float left, float top, float right, float bottom, 193 SkRegion::Op op) { 194 addStateOp(new (alloc()) ClipRectOp(left, top, right, bottom, op)); 195 return mState.clipRect(left, top, right, bottom, op); 196} 197 198bool DisplayListCanvas::clipPath(const SkPath* path, SkRegion::Op op) { 199 path = refPath(path); 200 addStateOp(new (alloc()) ClipPathOp(path, op)); 201 return mState.clipPath(path, op); 202} 203 204bool DisplayListCanvas::clipRegion(const SkRegion* region, SkRegion::Op op) { 205 region = refRegion(region); 206 addStateOp(new (alloc()) ClipRegionOp(region, op)); 207 return mState.clipRegion(region, op); 208} 209 210void DisplayListCanvas::drawRenderNode(RenderNode* renderNode) { 211 LOG_ALWAYS_FATAL_IF(!renderNode, "missing rendernode"); 212 DrawRenderNodeOp* op = new (alloc()) DrawRenderNodeOp( 213 renderNode, 214 *mState.currentTransform(), 215 mState.clipIsSimple()); 216 addRenderNodeOp(op); 217} 218 219void DisplayListCanvas::drawLayer(DeferredLayerUpdater* layerHandle, float x, float y) { 220 // We ref the DeferredLayerUpdater due to its thread-safe ref-counting 221 // semantics. 222 mDisplayListData->ref(layerHandle); 223 addDrawOp(new (alloc()) DrawLayerOp(layerHandle->backingLayer(), x, y)); 224} 225 226void DisplayListCanvas::drawBitmap(const SkBitmap* bitmap, const SkPaint* paint) { 227 bitmap = refBitmap(*bitmap); 228 paint = refPaint(paint); 229 230 addDrawOp(new (alloc()) DrawBitmapOp(bitmap, paint)); 231} 232 233void DisplayListCanvas::drawBitmap(const SkBitmap& bitmap, float left, float top, 234 const SkPaint* paint) { 235 save(SkCanvas::kMatrix_SaveFlag); 236 translate(left, top); 237 drawBitmap(&bitmap, paint); 238 restore(); 239} 240 241void DisplayListCanvas::drawBitmap(const SkBitmap& bitmap, const SkMatrix& matrix, 242 const SkPaint* paint) { 243 if (matrix.isIdentity()) { 244 drawBitmap(&bitmap, paint); 245 } else if (!(matrix.getType() & ~(SkMatrix::kScale_Mask | SkMatrix::kTranslate_Mask))) { 246 // SkMatrix::isScaleTranslate() not available in L 247 SkRect src; 248 SkRect dst; 249 bitmap.getBounds(&src); 250 matrix.mapRect(&dst, src); 251 drawBitmap(bitmap, src.fLeft, src.fTop, src.fRight, src.fBottom, 252 dst.fLeft, dst.fTop, dst.fRight, dst.fBottom, paint); 253 } else { 254 save(SkCanvas::kMatrix_SaveFlag); 255 concat(matrix); 256 drawBitmap(&bitmap, paint); 257 restore(); 258 } 259} 260 261void DisplayListCanvas::drawBitmap(const SkBitmap& bitmap, float srcLeft, float srcTop, 262 float srcRight, float srcBottom, float dstLeft, float dstTop, 263 float dstRight, float dstBottom, const SkPaint* paint) { 264 if (srcLeft == 0 && srcTop == 0 265 && srcRight == bitmap.width() 266 && srcBottom == bitmap.height() 267 && (srcBottom - srcTop == dstBottom - dstTop) 268 && (srcRight - srcLeft == dstRight - dstLeft)) { 269 // transform simple rect to rect drawing case into position bitmap ops, since they merge 270 save(SkCanvas::kMatrix_SaveFlag); 271 translate(dstLeft, dstTop); 272 drawBitmap(&bitmap, paint); 273 restore(); 274 } else { 275 paint = refPaint(paint); 276 277 if (paint && paint->getShader()) { 278 float scaleX = (dstRight - dstLeft) / (srcRight - srcLeft); 279 float scaleY = (dstBottom - dstTop) / (srcBottom - srcTop); 280 if (!MathUtils::areEqual(scaleX, 1.0f) || !MathUtils::areEqual(scaleY, 1.0f)) { 281 // Apply the scale transform on the canvas, so that the shader 282 // effectively calculates positions relative to src rect space 283 284 save(SkCanvas::kMatrix_SaveFlag); 285 translate(dstLeft, dstTop); 286 scale(scaleX, scaleY); 287 288 dstLeft = 0.0f; 289 dstTop = 0.0f; 290 dstRight = srcRight - srcLeft; 291 dstBottom = srcBottom - srcTop; 292 293 addDrawOp(new (alloc()) DrawBitmapRectOp(refBitmap(bitmap), 294 srcLeft, srcTop, srcRight, srcBottom, 295 dstLeft, dstTop, dstRight, dstBottom, paint)); 296 restore(); 297 return; 298 } 299 } 300 301 addDrawOp(new (alloc()) DrawBitmapRectOp(refBitmap(bitmap), 302 srcLeft, srcTop, srcRight, srcBottom, 303 dstLeft, dstTop, dstRight, dstBottom, paint)); 304 } 305} 306 307void DisplayListCanvas::drawBitmapMesh(const SkBitmap& bitmap, int meshWidth, int meshHeight, 308 const float* vertices, const int* colors, const SkPaint* paint) { 309 int vertexCount = (meshWidth + 1) * (meshHeight + 1); 310 vertices = refBuffer<float>(vertices, vertexCount * 2); // 2 floats per vertex 311 paint = refPaint(paint); 312 colors = refBuffer<int>(colors, vertexCount); // 1 color per vertex 313 314 addDrawOp(new (alloc()) DrawBitmapMeshOp(refBitmap(bitmap), meshWidth, meshHeight, 315 vertices, colors, paint)); 316} 317 318void DisplayListCanvas::drawPatch(const SkBitmap& bitmap, const Res_png_9patch* patch, 319 float left, float top, float right, float bottom, const SkPaint* paint) { 320 const SkBitmap* bitmapPtr = refBitmap(bitmap); 321 patch = refPatch(patch); 322 paint = refPaint(paint); 323 324 addDrawOp(new (alloc()) DrawPatchOp(bitmapPtr, patch, left, top, right, bottom, paint)); 325} 326 327void DisplayListCanvas::drawColor(int color, SkXfermode::Mode mode) { 328 addDrawOp(new (alloc()) DrawColorOp(color, mode)); 329} 330 331void DisplayListCanvas::drawPaint(const SkPaint& paint) { 332 SkRect bounds; 333 if (getClipBounds(&bounds)) { 334 drawRect(bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom, paint); 335 } 336} 337 338 339void DisplayListCanvas::drawRect(float left, float top, float right, float bottom, 340 const SkPaint& paint) { 341 addDrawOp(new (alloc()) DrawRectOp(left, top, right, bottom, refPaint(&paint))); 342} 343 344void DisplayListCanvas::drawRoundRect(float left, float top, float right, float bottom, 345 float rx, float ry, const SkPaint& paint) { 346 addDrawOp(new (alloc()) DrawRoundRectOp(left, top, right, bottom, rx, ry, refPaint(&paint))); 347} 348 349void DisplayListCanvas::drawRoundRect( 350 CanvasPropertyPrimitive* left, CanvasPropertyPrimitive* top, 351 CanvasPropertyPrimitive* right, CanvasPropertyPrimitive* bottom, 352 CanvasPropertyPrimitive* rx, CanvasPropertyPrimitive* ry, 353 CanvasPropertyPaint* paint) { 354 mDisplayListData->ref(left); 355 mDisplayListData->ref(top); 356 mDisplayListData->ref(right); 357 mDisplayListData->ref(bottom); 358 mDisplayListData->ref(rx); 359 mDisplayListData->ref(ry); 360 mDisplayListData->ref(paint); 361 refBitmapsInShader(paint->value.getShader()); 362 addDrawOp(new (alloc()) DrawRoundRectPropsOp(&left->value, &top->value, 363 &right->value, &bottom->value, &rx->value, &ry->value, &paint->value)); 364} 365 366void DisplayListCanvas::drawCircle(float x, float y, float radius, const SkPaint& paint) { 367 addDrawOp(new (alloc()) DrawCircleOp(x, y, radius, refPaint(&paint))); 368} 369 370void DisplayListCanvas::drawCircle(CanvasPropertyPrimitive* x, CanvasPropertyPrimitive* y, 371 CanvasPropertyPrimitive* radius, CanvasPropertyPaint* paint) { 372 mDisplayListData->ref(x); 373 mDisplayListData->ref(y); 374 mDisplayListData->ref(radius); 375 mDisplayListData->ref(paint); 376 refBitmapsInShader(paint->value.getShader()); 377 addDrawOp(new (alloc()) DrawCirclePropsOp(&x->value, &y->value, 378 &radius->value, &paint->value)); 379} 380 381void DisplayListCanvas::drawOval(float left, float top, float right, float bottom, 382 const SkPaint& paint) { 383 addDrawOp(new (alloc()) DrawOvalOp(left, top, right, bottom, refPaint(&paint))); 384} 385 386void DisplayListCanvas::drawArc(float left, float top, float right, float bottom, 387 float startAngle, float sweepAngle, bool useCenter, const SkPaint& paint) { 388 if (fabs(sweepAngle) >= 360.0f) { 389 drawOval(left, top, right, bottom, paint); 390 } else { 391 addDrawOp(new (alloc()) DrawArcOp(left, top, right, bottom, 392 startAngle, sweepAngle, useCenter, refPaint(&paint))); 393 } 394} 395 396void DisplayListCanvas::drawPath(const SkPath& path, const SkPaint& paint) { 397 addDrawOp(new (alloc()) DrawPathOp(refPath(&path), refPaint(&paint))); 398} 399 400void DisplayListCanvas::drawLines(const float* points, int count, const SkPaint& paint) { 401 points = refBuffer<float>(points, count); 402 403 addDrawOp(new (alloc()) DrawLinesOp(points, count, refPaint(&paint))); 404} 405 406void DisplayListCanvas::drawPoints(const float* points, int count, const SkPaint& paint) { 407 points = refBuffer<float>(points, count); 408 409 addDrawOp(new (alloc()) DrawPointsOp(points, count, refPaint(&paint))); 410} 411 412void DisplayListCanvas::drawTextOnPath(const uint16_t* glyphs, int count, 413 const SkPath& path, float hOffset, float vOffset, const SkPaint& paint) { 414 if (!glyphs || count <= 0) return; 415 416 int bytesCount = 2 * count; 417 DrawOp* op = new (alloc()) DrawTextOnPathOp(refText((const char*) glyphs, bytesCount), 418 bytesCount, count, refPath(&path), 419 hOffset, vOffset, refPaint(&paint)); 420 addDrawOp(op); 421} 422 423void DisplayListCanvas::drawPosText(const uint16_t* text, const float* positions, 424 int count, int posCount, const SkPaint& paint) { 425 if (!text || count <= 0) return; 426 427 int bytesCount = 2 * count; 428 positions = refBuffer<float>(positions, count * 2); 429 430 DrawOp* op = new (alloc()) DrawPosTextOp(refText((const char*) text, bytesCount), 431 bytesCount, count, positions, refPaint(&paint)); 432 addDrawOp(op); 433} 434 435static void simplifyPaint(int color, SkPaint* paint) { 436 paint->setColor(color); 437 paint->setShader(nullptr); 438 paint->setColorFilter(nullptr); 439 paint->setLooper(nullptr); 440 paint->setStrokeWidth(4 + 0.04 * paint->getTextSize()); 441 paint->setStrokeJoin(SkPaint::kRound_Join); 442 paint->setLooper(nullptr); 443} 444 445void DisplayListCanvas::drawText(const uint16_t* glyphs, const float* positions, 446 int count, const SkPaint& paint, float x, float y, 447 float boundsLeft, float boundsTop, float boundsRight, float boundsBottom, 448 float totalAdvance) { 449 450 if (!glyphs || count <= 0 || PaintUtils::paintWillNotDrawText(paint)) return; 451 452 int bytesCount = count * 2; 453 const char* text = refText((const char*) glyphs, bytesCount); 454 positions = refBuffer<float>(positions, count * 2); 455 Rect bounds(boundsLeft, boundsTop, boundsRight, boundsBottom); 456 457 if (CC_UNLIKELY(mHighContrastText)) { 458 // high contrast draw path 459 int color = paint.getColor(); 460 int channelSum = SkColorGetR(color) + SkColorGetG(color) + SkColorGetB(color); 461 bool darken = channelSum < (128 * 3); 462 463 // outline 464 SkPaint* outlinePaint = copyPaint(&paint); 465 simplifyPaint(darken ? SK_ColorWHITE : SK_ColorBLACK, outlinePaint); 466 outlinePaint->setStyle(SkPaint::kStrokeAndFill_Style); 467 addDrawOp(new (alloc()) DrawTextOp(text, bytesCount, count, 468 x, y, positions, outlinePaint, totalAdvance, bounds)); // bounds? 469 470 // inner 471 SkPaint* innerPaint = copyPaint(&paint); 472 simplifyPaint(darken ? SK_ColorBLACK : SK_ColorWHITE, innerPaint); 473 innerPaint->setStyle(SkPaint::kFill_Style); 474 addDrawOp(new (alloc()) DrawTextOp(text, bytesCount, count, 475 x, y, positions, innerPaint, totalAdvance, bounds)); 476 } else { 477 // standard draw path 478 DrawOp* op = new (alloc()) DrawTextOp(text, bytesCount, count, 479 x, y, positions, refPaint(&paint), totalAdvance, bounds); 480 addDrawOp(op); 481 } 482} 483 484void DisplayListCanvas::drawRects(const float* rects, int count, const SkPaint* paint) { 485 if (count <= 0) return; 486 487 rects = refBuffer<float>(rects, count); 488 paint = refPaint(paint); 489 addDrawOp(new (alloc()) DrawRectsOp(rects, count, paint)); 490} 491 492void DisplayListCanvas::setDrawFilter(SkDrawFilter* filter) { 493 mDrawFilter.reset(SkSafeRef(filter)); 494} 495 496void DisplayListCanvas::insertReorderBarrier(bool enableReorder) { 497 flushRestoreToCount(); 498 flushTranslate(); 499 mDeferredBarrierType = enableReorder ? kBarrier_OutOfOrder : kBarrier_InOrder; 500} 501 502void DisplayListCanvas::flushRestoreToCount() { 503 if (mRestoreSaveCount >= 0) { 504 addOpAndUpdateChunk(new (alloc()) RestoreToCountOp(mRestoreSaveCount)); 505 mRestoreSaveCount = -1; 506 } 507} 508 509void DisplayListCanvas::flushTranslate() { 510 if (mHasDeferredTranslate) { 511 if (mTranslateX != 0.0f || mTranslateY != 0.0f) { 512 addOpAndUpdateChunk(new (alloc()) TranslateOp(mTranslateX, mTranslateY)); 513 mTranslateX = mTranslateY = 0.0f; 514 } 515 mHasDeferredTranslate = false; 516 } 517} 518 519size_t DisplayListCanvas::addOpAndUpdateChunk(DisplayListOp* op) { 520 int insertIndex = mDisplayListData->displayListOps.add(op); 521 if (mDeferredBarrierType != kBarrier_None) { 522 // op is first in new chunk 523 mDisplayListData->chunks.push(); 524 DisplayListData::Chunk& newChunk = mDisplayListData->chunks.editTop(); 525 newChunk.beginOpIndex = insertIndex; 526 newChunk.endOpIndex = insertIndex + 1; 527 newChunk.reorderChildren = (mDeferredBarrierType == kBarrier_OutOfOrder); 528 529 int nextChildIndex = mDisplayListData->children().size(); 530 newChunk.beginChildIndex = newChunk.endChildIndex = nextChildIndex; 531 mDeferredBarrierType = kBarrier_None; 532 } else { 533 // standard case - append to existing chunk 534 mDisplayListData->chunks.editTop().endOpIndex = insertIndex + 1; 535 } 536 return insertIndex; 537} 538 539size_t DisplayListCanvas::flushAndAddOp(DisplayListOp* op) { 540 flushRestoreToCount(); 541 flushTranslate(); 542 return addOpAndUpdateChunk(op); 543} 544 545size_t DisplayListCanvas::addStateOp(StateOp* op) { 546 return flushAndAddOp(op); 547} 548 549size_t DisplayListCanvas::addDrawOp(DrawOp* op) { 550 Rect localBounds; 551 if (op->getLocalBounds(localBounds)) { 552 bool rejected = quickRejectRect(localBounds.left, localBounds.top, 553 localBounds.right, localBounds.bottom); 554 op->setQuickRejected(rejected); 555 } 556 557 mDisplayListData->hasDrawOps = true; 558 return flushAndAddOp(op); 559} 560 561size_t DisplayListCanvas::addRenderNodeOp(DrawRenderNodeOp* op) { 562 int opIndex = addDrawOp(op); 563 int childIndex = mDisplayListData->addChild(op); 564 565 // update the chunk's child indices 566 DisplayListData::Chunk& chunk = mDisplayListData->chunks.editTop(); 567 chunk.endChildIndex = childIndex + 1; 568 569 if (op->renderNode()->stagingProperties().isProjectionReceiver()) { 570 // use staging property, since recording on UI thread 571 mDisplayListData->projectionReceiveIndex = opIndex; 572 } 573 return opIndex; 574} 575 576void DisplayListCanvas::refBitmapsInShader(const SkShader* shader) { 577 if (!shader) return; 578 579 // If this paint has an SkShader that has an SkBitmap add 580 // it to the bitmap pile 581 SkBitmap bitmap; 582 SkShader::TileMode xy[2]; 583 if (shader->asABitmap(&bitmap, nullptr, xy) == SkShader::kDefault_BitmapType) { 584 refBitmap(bitmap); 585 return; 586 } 587 SkShader::ComposeRec rec; 588 if (shader->asACompose(&rec)) { 589 refBitmapsInShader(rec.fShaderA); 590 refBitmapsInShader(rec.fShaderB); 591 return; 592 } 593} 594 595}; // namespace uirenderer 596}; // namespace android 597