/development/samples/ApiDemos/src/com/example/android/apis/graphics/ |
D | PolyToPoly.java | 41 private void doDraw(Canvas canvas, float src[], float dst[]) { in doDraw() argument 42 canvas.save(); in doDraw() 44 canvas.concat(mMatrix); in doDraw() 48 canvas.drawRect(0, 0, 64, 64, mPaint); in doDraw() 49 canvas.drawLine(0, 0, 64, 64, mPaint); in doDraw() 50 canvas.drawLine(0, 64, 64, 0, mPaint); in doDraw() 59 canvas.drawText(src.length/2 + "", x, y, mPaint); in doDraw() 61 canvas.restore(); in doDraw() 76 protected void onDraw(Canvas canvas) { in onDraw() argument 77 canvas.drawColor(Color.WHITE); in onDraw() [all …]
|
D | Clipping.java | 49 private void drawScene(Canvas canvas) { in drawScene() argument 50 canvas.clipRect(0, 0, 100, 100); in drawScene() 52 canvas.drawColor(Color.WHITE); in drawScene() 55 canvas.drawLine(0, 0, 100, 100, mPaint); in drawScene() 58 canvas.drawCircle(30, 70, 30, mPaint); in drawScene() 61 canvas.drawText("Clipping", 100, 30, mPaint); in drawScene() 64 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 65 canvas.drawColor(Color.GRAY); in onDraw() 67 canvas.save(); in onDraw() 68 canvas.translate(10, 10); in onDraw() [all …]
|
D | Regions.java | 49 private void drawOriginalRects(Canvas canvas, int alpha) { in drawOriginalRects() argument 53 drawCentered(canvas, mRect1, mPaint); in drawOriginalRects() 56 drawCentered(canvas, mRect2, mPaint); in drawOriginalRects() 62 private void drawRgn(Canvas canvas, int color, String str, Region.Op op) { in drawRgn() argument 65 canvas.drawText(str, 80, 24, mPaint); in drawRgn() 76 canvas.translate(0, 30); in drawRgn() 79 canvas.drawRect(r, mPaint); in drawRgn() 81 drawOriginalRects(canvas, 0x80); in drawRgn() 94 protected void onDraw(Canvas canvas) { in onDraw() argument 95 canvas.drawColor(Color.GRAY); in onDraw() [all …]
|
D | RoundRects.java | 60 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 66 canvas.save(); in onDraw() 67 canvas.translate(10, 10); in onDraw() 70 mDrawable.draw(canvas); in onDraw() 71 canvas.restore(); in onDraw() 73 canvas.save(); in onDraw() 74 canvas.translate(10 + mRect.width() + 10, 10); in onDraw() 77 mDrawable.draw(canvas); in onDraw() 78 canvas.restore(); in onDraw() 80 canvas.translate(0, mRect.height() + 10); in onDraw() [all …]
|
D | ScaleToFit.java | 76 private void drawSrcR(Canvas canvas, int index) { in drawSrcR() argument 78 canvas.drawOval(mSrcR, mPaint); in drawSrcR() 81 private void drawFit(Canvas canvas, int index, Matrix.ScaleToFit stf) { in drawFit() argument 82 canvas.save(); in drawFit() 86 canvas.concat(mMatrix); in drawFit() 87 drawSrcR(canvas, index); in drawFit() 89 canvas.restore(); in drawFit() 91 canvas.drawRect(mDstR, mHairPaint); in drawFit() 95 protected void onDraw(Canvas canvas) { in onDraw() argument 96 canvas.drawColor(Color.WHITE); in onDraw() [all …]
|
D | TextAlign.java | 87 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 88 canvas.drawColor(Color.WHITE); in onDraw() 98 canvas.drawLine(x, y, x, y+DY*3, p); in onDraw() 101 canvas.translate(0, DY); in onDraw() 103 canvas.drawText(TEXT_L, x, y, p); in onDraw() 105 canvas.translate(0, DY); in onDraw() 107 canvas.drawText(TEXT_C, x, y, p); in onDraw() 109 canvas.translate(0, DY); in onDraw() 111 canvas.drawText(TEXT_R, x, y, p); in onDraw() 113 canvas.translate(100, DY*2); in onDraw() [all …]
|
D | PathFillTypes.java | 50 private void showPath(Canvas canvas, int x, int y, Path.FillType ft, in showPath() argument 52 canvas.save(); in showPath() 53 canvas.translate(x, y); in showPath() 54 canvas.clipRect(0, 0, 120, 120); in showPath() 55 canvas.drawColor(Color.WHITE); in showPath() 57 canvas.drawPath(mPath, paint); in showPath() 58 canvas.restore(); in showPath() 61 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 64 canvas.drawColor(0xFFCCCCCC); in onDraw() 66 canvas.translate(20, 20); in onDraw() [all …]
|
D | MeasureText.java | 68 private void showText(Canvas canvas, String text, Paint.Align align) { in showText() argument 79 canvas.drawRect(bounds, mPaint); in showText() 81 canvas.drawText(text, 0, 0, mPaint); in showText() 95 canvas.drawLine(0, 0, w, 0, mPaint); in showText() 97 canvas.drawPoints(pts, 0, (count + 1) << 1, mPaint); in showText() 100 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 101 canvas.drawColor(Color.WHITE); in onDraw() 103 canvas.translate(mOriginX, mOriginY); in onDraw() 105 showText(canvas, "Measure", Paint.Align.LEFT); in onDraw() 106 canvas.translate(0, 80); in onDraw() [all …]
|
D | PictureLayout.java | 108 private void drawPict(Canvas canvas, int x, int y, int w, int h, in drawPict() argument 110 canvas.save(); in drawPict() 111 canvas.translate(x, y); in drawPict() 112 canvas.clipRect(0, 0, w, h); in drawPict() 113 canvas.scale(0.5f, 0.5f); in drawPict() 114 canvas.scale(sx, sy, w, h); in drawPict() 115 canvas.drawPicture(mPicture); in drawPict() 116 canvas.restore(); in drawPict() 120 protected void dispatchDraw(Canvas canvas) { in dispatchDraw() argument 128 canvas.drawPicture(mPicture); in dispatchDraw() [all …]
|
D | Pictures.java | 40 static void drawSomething(Canvas canvas) { in drawSomething() argument 44 canvas.drawCircle(50, 50, 40, p); in drawSomething() 48 canvas.drawText("Pictures", 60, 60, p); in drawSomething() 63 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 64 canvas.drawColor(Color.WHITE); in onDraw() 66 canvas.drawPicture(mPicture); in onDraw() 68 canvas.drawPicture(mPicture, new RectF(0, 100, getWidth(), 200)); in onDraw() 71 mDrawable.draw(canvas); in onDraw()
|
D | Layers.java | 43 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 44 canvas.drawColor(Color.WHITE); in onDraw() 46 canvas.translate(10, 10); in onDraw() 48 canvas.saveLayerAlpha(0, 0, 200, 200, 0x88); in onDraw() 51 canvas.drawCircle(75, 75, 75, mPaint); in onDraw() 53 canvas.drawCircle(125, 125, 75, mPaint); in onDraw() 55 canvas.restore(); in onDraw()
|
D | WindowSurface.java | 209 Canvas canvas = mSurface.lockCanvas(); in run() local 210 if (canvas == null) { in run() 218 mPoint1.init(canvas.getWidth(), canvas.getHeight(), mMinStep); in run() 219 mPoint2.init(canvas.getWidth(), canvas.getHeight(), mMinStep); in run() 222 mPoint1.step(canvas.getWidth(), canvas.getHeight(), in run() 224 mPoint2.step(canvas.getWidth(), canvas.getHeight(), in run() 234 canvas.drawColor(mBackground.getColor()); in run() 241 canvas.drawLine(mOld[p], mOld[p+1], mOld[p+2], mOld[p+3], mForeground); in run() 251 canvas.drawLine(mPoint1.x, mPoint1.y, mPoint2.x, mPoint2.y, mForeground); in run() 266 mSurface.unlockCanvasAndPost(canvas); in run()
|
D | Typefaces.java | 47 protected void onDraw(Canvas canvas) { in onDraw() argument 48 canvas.drawColor(Color.WHITE); in onDraw() 50 canvas.drawText("Draw with Default:", 10, 100, mPaint); in onDraw() 51 canvas.drawText(" SAMPLE TEXT", 10, 200, mPaint); in onDraw() 52 canvas.drawText("Draw with Custom Font", 10, 400, mPaint); in onDraw() 53 canvas.drawText("(Custom Font draws 'A' with solid triangle.)", 10, 500, mPaint); in onDraw() 55 canvas.drawText(" SAMPLE TEXT", 10, 600, mPaint); in onDraw()
|
D | Vertices.java | 78 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 79 canvas.drawColor(0xFFCCCCCC); in onDraw() 80 canvas.save(); in onDraw() 81 canvas.concat(mMatrix); in onDraw() 83 canvas.drawVertices(Canvas.VertexMode.TRIANGLE_FAN, 10, mVerts, 0, in onDraw() 86 canvas.translate(0, 240); in onDraw() 87 canvas.drawVertices(Canvas.VertexMode.TRIANGLE_FAN, 10, mVerts, 0, in onDraw() 90 canvas.restore(); in onDraw()
|
D | ColorFilters.java | 127 private void drawSample(Canvas canvas, ColorFilter filter) { in drawSample() argument 133 mDrawable.draw(canvas); in drawSample() 134 canvas.drawText("Label", x+1, y+1, mPaint2); in drawSample() 135 canvas.drawText("Label", x, y, mPaint); in drawSample() 139 dr.draw(canvas); in drawSample() 143 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 144 canvas.drawColor(0xFFCCCCCC); in onDraw() 146 canvas.translate(8, 12); in onDraw() 155 drawSample(canvas, filter); in onDraw() 156 canvas.translate(0, 55); in onDraw()
|
D | Xfermodes.java | 117 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 118 canvas.drawColor(Color.WHITE); in onDraw() 126 canvas.translate(15, 35); in onDraw() 134 canvas.drawRect(x - 0.5f, y - 0.5f, in onDraw() 140 canvas.drawRect(x, y, x + W, y + H, paint); in onDraw() 143 int sc = canvas.saveLayer(x, y, x + W, y + H, null); in onDraw() 144 canvas.translate(x, y); in onDraw() 145 canvas.drawBitmap(mDstB, 0, 0, paint); in onDraw() 147 canvas.drawBitmap(mSrcB, 0, 0, paint); in onDraw() 149 canvas.restoreToCount(sc); in onDraw() [all …]
|
D | CreateBitmap.java | 107 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 108 canvas.drawColor(Color.WHITE); in onDraw() 111 canvas.drawBitmap(mBitmaps[i], 0, 0, null); in onDraw() 112 canvas.drawBitmap(mJPEG[i], 80, 0, null); in onDraw() 113 canvas.drawBitmap(mPNG[i], 160, 0, null); in onDraw() 114 canvas.translate(0, mBitmaps[i].getHeight()); in onDraw() 118 canvas.drawBitmap(mColors, 0, STRIDE, 0, 0, WIDTH, HEIGHT, in onDraw() 120 canvas.translate(0, HEIGHT); in onDraw() 121 canvas.drawBitmap(mColors, 0, STRIDE, 0, 0, WIDTH, HEIGHT, in onDraw()
|
D | Arcs.java | 89 private void drawArcs(Canvas canvas, RectF oval, boolean useCenter, in drawArcs() argument 91 canvas.drawRect(oval, mFramePaint); in drawArcs() 92 canvas.drawArc(oval, mStart, mSweep, useCenter, paint); in drawArcs() 95 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 96 canvas.drawColor(Color.WHITE); in onDraw() 98 drawArcs(canvas, mBigOval, mUseCenters[mBigIndex], in onDraw() 102 drawArcs(canvas, mOvals[i], mUseCenters[i], mPaints[i]); in onDraw()
|
D | UnicodeChart.java | 82 private void drawChart(Canvas canvas, int base) { in drawChart() argument 88 canvas.drawText(Integer.toHexString(unichar), in drawChart() 91 canvas.drawPosText(chars, 0, 256, mPos, mBigCharPaint); in drawChart() 94 @Override protected void onDraw(Canvas canvas) { in onDraw() argument 95 canvas.drawColor(Color.WHITE); in onDraw() 97 canvas.translate(0, 1); in onDraw() 98 drawChart(canvas, mBase * 256); in onDraw()
|
/development/samples/CrossCompatibility/src/com/example/android/touchexample/ |
D | TouchExampleView.java | 56 public void onDraw(Canvas canvas) { in onDraw() argument 57 super.onDraw(canvas); in onDraw() 59 canvas.save(); in onDraw() 60 canvas.translate(mPosX, mPosY); in onDraw() 61 canvas.scale(mScaleFactor, mScaleFactor); in onDraw() 62 mIcon.draw(canvas); in onDraw() 63 canvas.restore(); in onDraw()
|
/development/samples/browseable/WatchFace/Wearable/src/com.example.android.wearable.watchface/ |
D | SweepWatchFaceService.java | 306 Canvas canvas = new Canvas(mGrayBackgroundBitmap); in initGrayBackgroundBitmap() local 312 canvas.drawBitmap(mBackgroundBitmap, 0, 0, grayPaint); in initGrayBackgroundBitmap() 316 public void onDraw(Canvas canvas, Rect bounds) { in onDraw() argument 324 canvas.drawColor(Color.BLACK); in onDraw() 326 canvas.drawBitmap(mGrayBackgroundBitmap, 0, 0, mBackgroundPaint); in onDraw() 328 canvas.drawBitmap(mBackgroundBitmap, 0, 0, mBackgroundPaint); in onDraw() 344 canvas.drawLine(mCenterX + innerX, mCenterY + innerY, in onDraw() 364 canvas.save(); in onDraw() 366 canvas.rotate(hoursRotation, mCenterX, mCenterY); in onDraw() 367 canvas.drawLine( in onDraw() [all …]
|
D | ComplicationSimpleWatchFaceService.java | 532 Canvas canvas = new Canvas(mGrayBackgroundBitmap); in initGrayBackgroundBitmap() local 538 canvas.drawBitmap(mBackgroundBitmap, 0, 0, grayPaint); in initGrayBackgroundBitmap() 542 public void onDraw(Canvas canvas, Rect bounds) { in onDraw() argument 549 drawBackground(canvas); in onDraw() 550 drawComplications(canvas, now); in onDraw() 551 drawWatchFace(canvas); in onDraw() 556 private void drawBackground(Canvas canvas) { in drawBackground() argument 558 canvas.drawColor(Color.BLACK); in drawBackground() 560 canvas.drawBitmap(mGrayBackgroundBitmap, 0, 0, mBackgroundPaint); in drawBackground() 562 canvas.drawBitmap(mBackgroundBitmap, 0, 0, mBackgroundPaint); in drawBackground() [all …]
|
D | AnalogWatchFaceService.java | 341 Canvas canvas = new Canvas(mGrayBackgroundBitmap); in initGrayBackgroundBitmap() local 347 canvas.drawBitmap(mBackgroundBitmap, 0, 0, grayPaint); in initGrayBackgroundBitmap() 351 public void onDraw(Canvas canvas, Rect bounds) { in onDraw() argument 359 canvas.drawColor(Color.BLACK); in onDraw() 361 canvas.drawBitmap(mGrayBackgroundBitmap, 0, 0, mBackgroundPaint); in onDraw() 363 canvas.drawBitmap(mBackgroundBitmap, 0, 0, mBackgroundPaint); in onDraw() 379 canvas.drawLine(mCenterX + innerX, mCenterY + innerY, in onDraw() 399 canvas.save(); in onDraw() 401 canvas.rotate(hoursRotation, mCenterX, mCenterY); in onDraw() 402 canvas.drawLine( in onDraw() [all …]
|
/development/samples/training/InteractiveChart/src/com/example/android/interactivechart/ |
D | InteractiveLineGraphView.java | 299 protected void onDraw(Canvas canvas) { in onDraw() argument 300 super.onDraw(canvas); in onDraw() 303 drawAxes(canvas); in onDraw() 306 int clipRestoreCount = canvas.save(); in onDraw() 307 canvas.clipRect(mContentRect); in onDraw() 309 drawDataSeriesUnclipped(canvas); in onDraw() 310 drawEdgeEffectsUnclipped(canvas); in onDraw() 313 canvas.restoreToCount(clipRestoreCount); in onDraw() 316 canvas.drawRect(mContentRect, mAxisPaint); in onDraw() 322 private void drawAxes(Canvas canvas) { in drawAxes() argument [all …]
|
/development/samples/devbytes/graphics/FoldingLayout/src/com/example/android/foldinglayout/ |
D | FoldingLayout.java | 279 Canvas canvas = new Canvas(mFullBitmap); in prepareFold() local 280 getChildAt(0).draw(canvas); in prepareFold() 486 protected void dispatchDraw(Canvas canvas) { 491 super.dispatchDraw(canvas); 505 canvas.save(); 510 canvas.concat(mMatrix[x]); 513 canvas.drawBitmap(mFullBitmap, src, mDstRect, null); 519 canvas.clipRect(0, 0, src.right - src.left, src.bottom - src.top); 522 canvas.translate(-src.left, 0); 524 canvas.translate(0, -src.top); [all …]
|