/frameworks/base/tests/graphics/HwAccelerationTest/src/com/android/test/hwui/ |
D | ShapesActivity.java | 79 protected void onDraw(Canvas canvas) { in onDraw() argument 80 super.onDraw(canvas); in onDraw() 82 canvas.save(); in onDraw() 83 canvas.translate(50.0f, 50.0f); in onDraw() 84 canvas.drawRoundRect(mRect, 6.0f, 6.0f, mNormalPaint); in onDraw() 86 canvas.translate(0.0f, 110.0f); in onDraw() 87 canvas.drawRoundRect(mRect, 6.0f, 6.0f, mStrokePaint); in onDraw() 89 canvas.translate(0.0f, 110.0f); in onDraw() 90 canvas.drawRoundRect(mRect, 6.0f, 6.0f, mFillPaint); in onDraw() 91 canvas.restore(); in onDraw() [all …]
|
D | XfermodeActivity.java | 54 protected void onDraw(Canvas canvas) { in onDraw() argument 55 super.onDraw(canvas); in onDraw() 58 canvas.translate(100.0f, 100.0f); in onDraw() 61 canvas.save(); in onDraw() 63 drawRects(canvas, Mode.SRC_OVER); in onDraw() 64 canvas.translate(0.0f, 100.0f); in onDraw() 66 drawRects(canvas, Mode.SRC_IN); in onDraw() 67 canvas.translate(0.0f, 100.0f); in onDraw() 69 drawRects(canvas, Mode.SRC_OUT); in onDraw() 70 canvas.translate(0.0f, 100.0f); in onDraw() [all …]
|
D | ColoredRectsActivity.java | 72 protected void onDraw(Canvas canvas) { in onDraw() argument 73 super.onDraw(canvas); in onDraw() 79 canvas.save(); in onDraw() 80 canvas.translate(mOffset, yOffset); in onDraw() 81 canvas.drawRect(0, 0, 20, 10, p); in onDraw() 82 canvas.drawRect(35, 0, 45, 20, p); in onDraw() 83 canvas.translate(0, -yOffset); in onDraw() 84 canvas.scale(2, 2); in onDraw() 85 canvas.translate(60, yOffset/2); in onDraw() 86 canvas.drawRect(0, 0, 20, 10, p); in onDraw() [all …]
|
D | Lines2Activity.java | 75 private void drawLines(Canvas canvas, Paint p, float xOffset, float yOffset) { in drawLines() argument 76 canvas.drawLine(10 + xOffset, yOffset, 10 + xOffset, 40 + yOffset, p); in drawLines() 77 canvas.drawLine(30 + xOffset, yOffset, 40 + xOffset, 40 + yOffset, p); in drawLines() 78 canvas.drawLine(40 + xOffset, yOffset, 75 + xOffset, 35 + yOffset, p); in drawLines() 79 canvas.drawLine(50 + xOffset, 5+ yOffset, 100 + xOffset, 15 + yOffset, p); in drawLines() 80 canvas.drawLine(60 + xOffset, yOffset, 110 + xOffset, 2 + yOffset, p); in drawLines() 81 canvas.drawLine(60 + xOffset, 40 + yOffset, 110 + xOffset, 40 + yOffset, p); in drawLines() 86 canvas.drawLines(copyPoints, 0, 12, p); in drawLines() 89 private void drawVerticalLine(Canvas canvas, Paint p, float length, float x, float y) { in drawVerticalLine() argument 90 canvas.drawLine(x, y, x, y + length, p); in drawVerticalLine() [all …]
|
D | AlphaLayersActivity.java | 65 protected void onDraw(Canvas canvas) { in onDraw() argument 66 super.onDraw(canvas); in onDraw() 67 canvas.drawRGB(0, 255, 0); in onDraw() 80 public void dispatchDraw(Canvas canvas) { in dispatchDraw() argument 81 canvas.drawRGB(255, 255, 255); in dispatchDraw() 84 canvas.drawRect(200.0f, 0.0f, 220.0f, 20.0f, mPaint); in dispatchDraw() 86 canvas.save(); in dispatchDraw() 87 canvas.clipRect(20.0f, 0.0f, 40.0f, 20.0f); in dispatchDraw() 88 Log.d(LOG_TAG, "clipRect = " + canvas.getClipBounds()); in dispatchDraw() 89 Log.d(LOG_TAG, "rejected = " + canvas.quickReject(100.0f, 100.0f, 110.0f, 110.0f)); in dispatchDraw() [all …]
|
D | QuickRejectActivity.java | 52 protected void onDraw(Canvas canvas) { in onDraw() argument 53 super.onDraw(canvas); in onDraw() 55 int count = canvas.getSaveCount(); in onDraw() 57 count = canvas.save(); in onDraw() 59 count = canvas.getSaveCount(); in onDraw() 61 canvas.restore(); in onDraw() 62 count = canvas.getSaveCount(); in onDraw() 64 canvas.save(); in onDraw() 65 Log.d("HWUI", "count after save=" + canvas.getSaveCount()); in onDraw() 66 canvas.save(); in onDraw() [all …]
|
D | ScaledTextActivity.java | 94 protected void onDraw(Canvas canvas) { in onDraw() argument 95 super.onDraw(canvas); in onDraw() 97 canvas.drawText(TEXT, 30.0f, 30.0f, mPaint); in onDraw() 99 canvas.drawText(TEXT, 30.0f, 50.0f, mPaint); in onDraw() 101 canvas.drawText(TEXT, 30.0f, 70.0f, mPaint); in onDraw() 103 canvas.save(); in onDraw() 104 canvas.translate(400.0f, 0.0f); in onDraw() 105 canvas.scale(3.0f, 3.0f); in onDraw() 108 canvas.drawText(TEXT, 30.0f, 30.0f, mPaint); in onDraw() 111 canvas.drawText(TEXT, 30.0f, 50.0f, mPaint); in onDraw() [all …]
|
D | TextActivity.java | 83 protected void onDraw(Canvas canvas) { in onDraw() argument 84 super.onDraw(canvas); in onDraw() 85 canvas.drawRGB(255, 255, 255); in onDraw() 87 canvas.drawText("Hello OpenGL renderer!", 300, 20, mEventPaint); in onDraw() 91 canvas.drawText("Hello OpenGL renderer!", 100, 20, mMediumPaint); in onDraw() 95 canvas.drawText("Hello OpenGL renderer!", 100, 40, mMediumPaint); in onDraw() 100 canvas.drawText("Hello OpenGL renderer!", 100, 60, mMediumPaint); in onDraw() 104 canvas.drawText("Hello OpenGL renderer!", 100, 100, mMediumPaint); in onDraw() 107 canvas.drawText("Hello OpenGL renderer!", 100, 150, mMediumPaint); in onDraw() 109 canvas.drawText("Hello OpenGL renderer!", 100, 200, mLargePaint); in onDraw() [all …]
|
D | LayersActivity.java | 48 protected void onDraw(Canvas canvas) { in onDraw() argument 49 super.onDraw(canvas); in onDraw() 51 canvas.translate(140.0f, 100.0f); in onDraw() 55 int count = canvas.saveLayer(0.0f, 0.0f, 200.0f, 100.0f, mLayerPaint, in onDraw() 59 canvas.drawRect(0.0f, 0.0f, 200.0f, 100.0f, mRectPaint); in onDraw() 61 canvas.restoreToCount(count); in onDraw() 63 canvas.translate(0.0f, 125.0f); in onDraw() 65 count = canvas.saveLayer(0.0f, 0.0f, 200.0f, 100.0f, mLayerPaint, in onDraw() 70 canvas.drawRect(0.0f, 0.0f, 200.0f, 100.0f, mRectPaint); in onDraw() 72 canvas.restoreToCount(count); in onDraw() [all …]
|
D | FramebufferBlendActivity.java | 64 protected void onDraw(Canvas canvas) { in onDraw() argument 65 super.onDraw(canvas); in onDraw() 66 canvas.drawRGB(255, 255, 255); in onDraw() 68 canvas.save(); in onDraw() 69 canvas.translate(40.0f, 40.0f); in onDraw() 71 drawBlendedBitmap(canvas, PorterDuff.Mode.DARKEN); in onDraw() 72 drawBlendedBitmap(canvas, PorterDuff.Mode.LIGHTEN); in onDraw() 73 drawBlendedBitmap(canvas, PorterDuff.Mode.MULTIPLY); in onDraw() 75 canvas.restore(); in onDraw() 77 canvas.save(); in onDraw() [all …]
|
D | LinesActivity.java | 115 protected void onDraw(Canvas canvas) { in onDraw() argument 116 super.onDraw(canvas); in onDraw() 118 canvas.save(); in onDraw() 119 canvas.translate(100.0f, 20.0f); in onDraw() 121 canvas.drawLine(0.0f, 0.0f, 40.0f, 400.0f, mSmallPaint); in onDraw() 122 canvas.drawLine(5.0f, 0.0f, 95.0f, 400.0f, mMediumPaint); in onDraw() 123 canvas.drawLine(22.0f, 0.0f, 162.0f, 400.0f, mLargePaint); in onDraw() 126 canvas.drawLine(42.0f, 0.0f, 222.0f, 400.0f, mLargePaint); in onDraw() 129 canvas.drawPoint(500.0f + x * (15.0f + mOffset), in onDraw() 135 canvas.drawLines(mPoints, mAlphaPaint); in onDraw() [all …]
|
D | ScaledPathsActivity.java | 61 protected void onDraw(Canvas canvas) { in onDraw() argument 62 super.onDraw(canvas); in onDraw() 63 canvas.drawARGB(255, 255, 255, 255); in onDraw() 68 canvas.save(); in onDraw() 69 drawPath(canvas, 1.0f, 1.0f); in onDraw() 70 drawPath(canvas, 2.0f, 2.0f); in onDraw() 71 drawPath(canvas, 4.0f, 4.0f); in onDraw() 72 canvas.restore(); in onDraw() 77 canvas.save(); in onDraw() 78 drawPath(canvas, 1.0f, 1.0f); in onDraw() [all …]
|
D | TJunctionActivity.java | 46 protected void onDraw(Canvas canvas) { in onDraw() argument 47 super.onDraw(canvas); in onDraw() 51 canvas.translate(10.0f, 10.0f); in onDraw() 52 canvas.drawRect(0.0f, 0.0f, 100.0f, 50.0f, mPaint); in onDraw() 56 canvas.translate(50.0f, 50.0f); in onDraw() 57 canvas.drawRect(0.0f, 0.0f, 100.0f, 50.0f, mPaint); in onDraw() 61 canvas.translate(-25.0f, 50.0f); in onDraw() 62 canvas.drawRect(0.0f, 0.0f, 100.0f, 50.0f, mPaint); in onDraw() 66 canvas.translate(150.0f, 75.0f); in onDraw() 67 canvas.drawRect(0.0f, 0.0f, 100.0f, 50.0f, mPaint); in onDraw() [all …]
|
D | PathsActivity.java | 101 Canvas canvas = new Canvas(mBitmap); in PathsView() local 102 canvas.translate(-mPathBounds.left + mOffset * 1.5f, -mPathBounds.top + mOffset * 1.5f); in PathsView() 103 canvas.drawPath(mPath, mMediumPaint); in PathsView() 104 canvas.setBitmap(null); in PathsView() 108 protected void onDraw(Canvas canvas) { in onDraw() argument 109 super.onDraw(canvas); in onDraw() 111 canvas.drawARGB(255, 255, 255, 255); in onDraw() 113 canvas.save(); in onDraw() 114 canvas.translate(200.0f, 60.0f); in onDraw() 115 canvas.drawPath(mPath, mSmallPaint); in onDraw() [all …]
|
/frameworks/base/libs/hwui/tests/microbench/ |
D | DisplayListCanvasBench.cpp | 50 auto canvas = std::make_unique<SkiaRecordingCanvas>(nullptr, 100, 100); in BM_SkiaDisplayListCanvas_record_empty() local 51 static_cast<void>(canvas->finishRecording()); in BM_SkiaDisplayListCanvas_record_empty() 54 canvas->resetRecording(100, 100); in BM_SkiaDisplayListCanvas_record_empty() 55 benchmark::DoNotOptimize(canvas.get()); in BM_SkiaDisplayListCanvas_record_empty() 56 static_cast<void>(canvas->finishRecording()); in BM_SkiaDisplayListCanvas_record_empty() 62 auto canvas = std::make_unique<SkiaRecordingCanvas>(nullptr, 100, 100); in BM_SkiaDisplayListCanvas_record_saverestore() local 63 static_cast<void>(canvas->finishRecording()); in BM_SkiaDisplayListCanvas_record_saverestore() 66 canvas->resetRecording(100, 100); in BM_SkiaDisplayListCanvas_record_saverestore() 67 canvas->save(SaveFlags::MatrixClip); in BM_SkiaDisplayListCanvas_record_saverestore() 68 canvas->save(SaveFlags::MatrixClip); in BM_SkiaDisplayListCanvas_record_saverestore() [all …]
|
D | CanvasOpBench.cpp | 38 CanvasFrontend<CanvasOpBuffer> canvas(100, 100); in BM_CanvasOpBuffer_record_saverestore() local 40 canvas.reset(100, 100); in BM_CanvasOpBuffer_record_saverestore() 41 canvas.save(SaveFlags::MatrixClip); in BM_CanvasOpBuffer_record_saverestore() 42 canvas.save(SaveFlags::MatrixClip); in BM_CanvasOpBuffer_record_saverestore() 43 benchmark::DoNotOptimize(&canvas); in BM_CanvasOpBuffer_record_saverestore() 44 canvas.restore(); in BM_CanvasOpBuffer_record_saverestore() 45 canvas.restore(); in BM_CanvasOpBuffer_record_saverestore() 46 canvas.finish(); in BM_CanvasOpBuffer_record_saverestore() 52 CanvasFrontend<CanvasOpBuffer> canvas(100, 100); in BM_CanvasOpBuffer_record_saverestoreWithReuse() local 55 canvas.reset(100, 100); in BM_CanvasOpBuffer_record_saverestoreWithReuse() [all …]
|
/frameworks/base/libs/hwui/tests/unit/ |
D | RenderNodeDrawableTests.cpp | 48 TestUtils::createNode(0, 0, 200, 400, [](RenderProperties& props, Canvas& canvas) { in TEST() argument 49 canvas.drawColor(Color::Red_500, SkBlendMode::kSrcOver); in TEST() 53 RecordingCanvas canvas; in TEST() local 54 canvas.reset(&skLiteDL, SkIRect::MakeWH(1, 1)); in TEST() 55 canvas.translate(100, 100); in TEST() 56 RenderNodeDrawable drawable(rootNode.get(), &canvas); in TEST() 60 ASSERT_EQ(drawable.getRecordedMatrix(), canvas.getTotalMatrix()); in TEST() 65 static void drawOrderedRect(Canvas* canvas, uint8_t expectedDrawOrder) { in drawOrderedRect() argument 69 canvas->drawRect(0, 0, 100, 100, paint); in drawOrderedRect() 72 static void drawOrderedNode(Canvas* canvas, uint8_t expectedDrawOrder, float z) { in drawOrderedNode() argument [all …]
|
D | CanvasOpTests.cpp | 135 CallCountingCanvas canvas; in TEST() local 136 EXPECT_EQ(0, canvas.sumTotalDrawCalls()); in TEST() 137 rasterizeCanvasBuffer(buffer, &canvas); in TEST() 138 EXPECT_EQ(1, canvas.drawPaintCount); in TEST() 139 EXPECT_EQ(1, canvas.sumTotalDrawCalls()); in TEST() 151 CallCountingCanvas canvas; in TEST() local 152 EXPECT_EQ(0, canvas.sumTotalDrawCalls()); in TEST() 153 rasterizeCanvasBuffer(buffer, &canvas); in TEST() 154 EXPECT_EQ(1, canvas.drawPoints); in TEST() 155 EXPECT_EQ(1, canvas.sumTotalDrawCalls()); in TEST() [all …]
|
/frameworks/base/libs/hwui/tests/common/scenes/ |
D | ShapeAnimation.cpp | 32 void createContent(int width, int height, Canvas& canvas) override { in createContent() argument 34 0, 0, width, height, [width](RenderProperties& props, Canvas& canvas) { in createContent() argument 36 [](Canvas& canvas, float size, const Paint& paint) { in createContent() 37 canvas.drawArc(0, 0, size, size, 50, 189, true, paint); in createContent() 39 [](Canvas& canvas, float size, const Paint& paint) { in createContent() 40 canvas.drawOval(0, 0, size, size, paint); in createContent() 42 [](Canvas& canvas, float size, const Paint& paint) { in createContent() 49 canvas.drawPath(diamondPath, paint); in createContent() 51 [](Canvas& canvas, float size, const Paint& paint) { in createContent() 53 canvas.drawLines(data, sizeof(data) / sizeof(float), paint); in createContent() [all …]
|
D | SaveLayerAnimation.cpp | 33 void createContent(int width, int height, Canvas& canvas) override { in createContent() argument 34 canvas.drawColor(Color::White, SkBlendMode::kSrcOver); // background in createContent() 36 card = TestUtils::createNode(0, 0, 400, 800, [](RenderProperties& props, Canvas& canvas) { in createContent() argument 38 canvas.saveLayerAlpha(0, 0, 400, 400, 200); in createContent() 39 canvas.drawColor(Color::Green_700, SkBlendMode::kSrcOver); in createContent() 40 canvas.clipRect(50, 50, 350, 350, SkClipOp::kIntersect); in createContent() 41 canvas.saveLayerAlpha(100, 100, 300, 300, 128); in createContent() 42 canvas.drawColor(Color::Blue_500, SkBlendMode::kSrcOver); in createContent() 43 canvas.restore(); in createContent() 44 canvas.restore(); in createContent() [all …]
|
D | ClippingAnimation.cpp | 32 void createContent(int width, int height, Canvas& canvas) override { in createContent() argument 33 canvas.drawColor(Color::White, SkBlendMode::kSrcOver); in createContent() 34 card = TestUtils::createNode(0, 0, 200, 400, [](RenderProperties& props, Canvas& canvas) { in createContent() argument 35 canvas.save(SaveFlags::MatrixClip); in createContent() 37 canvas.clipRect(0, 0, 200, 200, SkClipOp::kIntersect); in createContent() 38 canvas.translate(100, 100); in createContent() 39 canvas.rotate(45); in createContent() 40 canvas.translate(-100, -100); in createContent() 41 canvas.clipRect(0, 0, 200, 200, SkClipOp::kIntersect); in createContent() 42 canvas.drawColor(Color::Blue_500, SkBlendMode::kSrcOver); in createContent() [all …]
|
/frameworks/base/libs/hwui/canvas/ |
D | CanvasOps.h | 70 void draw(SkCanvas* canvas) const { canvas->save(); } 77 void draw(SkCanvas* canvas) const { canvas->saveLayer(saveLayerRec); } 84 void draw(SkCanvas* canvas) const { SkAndroidFrameworkUtils::SaveBehind(canvas, &bounds); } 90 void draw(SkCanvas* canvas) const { canvas->restore(); } 108 void draw(SkCanvas* canvas) const { canvas->clipRect(rect, clipOp); } 116 void draw(SkCanvas* canvas) const { canvas->clipPath(path, op, true); } 134 void draw(SkCanvas* canvas) const { 136 canvas->drawRoundRect(rect, rx->value, ry->value, paint->value); 148 void draw(SkCanvas* canvas) const { 149 canvas->drawCircle(x->value, y->value, radius->value, paint->value); [all …]
|
/frameworks/base/services/usb/java/com/android/server/usb/descriptors/ |
D | UsbEndpointDescriptor.java | 152 public void report(ReportCanvas canvas) { in report() argument 153 super.report(canvas); in report() 155 canvas.openList(); in report() 157 canvas.writeListItem("Address: " in report() 162 canvas.openListItem(); in report() 163 canvas.write("Attributes: " + ReportCanvas.getHexString(attributes) + " "); in report() 166 canvas.write("Control"); in report() 169 canvas.write("Iso"); in report() 172 canvas.write("Bulk"); in report() 175 canvas.write("Interrupt"); in report() [all …]
|
D | Usb10ACMixerUnit.java | 79 public void report(ReportCanvas canvas) { in report() argument 80 super.report(canvas); in report() 82 canvas.writeParagraph("Mixer Unit", false); in report() 83 canvas.openList(); in report() 85 canvas.writeListItem("Unit ID: " + ReportCanvas.getHexString(getUnitID())); in report() 88 canvas.openListItem(); in report() 89 canvas.write("Num Inputs: " + numInputs + " ["); in report() 91 canvas.write("" + ReportCanvas.getHexString(inputIDs[input])); in report() 93 canvas.write(" "); in report() 96 canvas.write("]"); in report() [all …]
|
/frameworks/base/libs/hwui/pipeline/skia/ |
D | RenderNodeDrawable.cpp | 41 RenderNodeDrawable::RenderNodeDrawable(RenderNode* node, SkCanvas* canvas, bool composeLayer, in RenderNodeDrawable() argument 44 , mRecordedTransform(canvas->getTotalMatrix()) in RenderNodeDrawable() 54 void RenderNodeDrawable::drawBackwardsProjectedNodes(SkCanvas* canvas, in drawBackwardsProjectedNodes() argument 64 SkAutoCanvasRestore acr2(canvas, true); in drawBackwardsProjectedNodes() 67 canvas->concat(child.getRecordedMatrix()); in drawBackwardsProjectedNodes() 68 child.drawContent(canvas); in drawBackwardsProjectedNodes() 74 SkAutoCanvasRestore acr(canvas, true); in drawBackwardsProjectedNodes() 80 canvas->concat(nodeMatrix); in drawBackwardsProjectedNodes() 83 drawBackwardsProjectedNodes(canvas, *childDisplayList, nestLevel + 1); in drawBackwardsProjectedNodes() 89 static void clipOutline(const Outline& outline, SkCanvas* canvas, const SkRect* pendingClip) { in clipOutline() argument [all …]
|