Draws the single frame of the Ripple Effect depending on Ripple Effect
{@link #currentRadius}

@param canvas canvas, which the Ripple Effect is drawing on
767660
private void drawRipple(Canvas canvas) {
		canvas.save();
		canvas.clipPath(getCircleClipPath(), Region.Op.INTERSECT);
		TouchPoint point = getActionButton().getTouchPoint();
		canvas.drawCircle(point.getLastX(), point.getLastY(), currentRadius, getPreparedPaint());
		canvas.restore();
	}
1240874
private void drawCircleDown(@NonNull Canvas canvas, float step, float radius) {
    canvas.drawCircle(
            xCoordinate + step,
            getMeasuredHeight() / 2,
            bounceDotRadius - radius,
            endPaint
    );
  }
157674
public void renderFrame(int frameNumber, Bitmap bitmap) {
    Canvas canvas = new Canvas(bitmap);
    canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.SRC);

    // If blending is required, prepare the canvas with the nearest cached frame.
    int nextIndex;
    if (!isKeyFrame(frameNumber)) {
      // Blending is required. nextIndex points to the next index to render onto the canvas.
      nextIndex = prepareCanvasWithClosestCachedFrame(frameNumber - 1, canvas);
    } else {
      // Blending isn't required. Start at the frame we're trying to render.
      nextIndex = frameNumber;
    }

    // Iterate from nextIndex to the frame number just preceding the one we're trying to render
    // and composite them in order according to the Disposal Method.
    for (int index = nextIndex; index < frameNumber; index++) {
      AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(index);
      DisposalMethod disposalMethod = frameInfo.disposalMethod;
      if (disposalMethod == DisposalMethod.DISPOSE_TO_PREVIOUS) {
        continue;
      }
      if (frameInfo.blendOperation == BlendOperation.NO_BLEND) {
        disposeToBackground(canvas, frameInfo);
      }
      mAnimatedDrawableBackend.renderFrame(index, canvas);
      mCallback.onIntermediateResult(index, bitmap);
      if (disposalMethod == DisposalMethod.DISPOSE_TO_BACKGROUND) {
        disposeToBackground(canvas, frameInfo);
      }
    }

    AnimatedDrawableFrameInfo frameInfo = mAnimatedDrawableBackend.getFrameInfo(frameNumber);
    if (frameInfo.blendOperation == BlendOperation.NO_BLEND) {
      disposeToBackground(canvas, frameInfo);
    }
    // Finally, we render the current frame. We don't dispose it.
    mAnimatedDrawableBackend.renderFrame(frameNumber, canvas);
  }
729785
@Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        // If the API level is less than 11, we can't rely on the view animation system to
        // do the scrolling animation. Need to tick it here and call postInvalidate() until the scrolling is done.
        if (Build.VERSION.SDK_INT < 11) {
            tickScrollAnimation();
            if (!mScroller.isFinished()) {
                mGraph.postInvalidate();
            }
        }
    }
523937
void updateRadius() {
		if (isPressed() && currentShadowRadius < getMaxShadowRadius()) {
			currentShadowRadius += SHADOW_DRAWING_STEP;
			getActionButton().getInvalidator().requireInvalidation();
		} else if (!isPressed() && currentShadowRadius > getMinShadowRadius()) {
			currentShadowRadius -= SHADOW_DRAWING_STEP;
			getActionButton().getInvalidator().requireInvalidation();
		} else if (!isPressed()){
			currentShadowRadius = getActionButton().getShadowRadius();
		}
		LOGGER.trace("Updated Shadow Responsive Effect current radius to: {}", currentShadowRadius);
	}
432159
@Override
	protected void onDrawFrame(SurfaceView view, Canvas canvas) {
		super.onDrawFrame(view, canvas);

		// Display info on the image being process and how fast input camera
		// stream (probably in YUV420) is converted into a BoofCV format
		int width = bitmap.getWidth();
		int height = bitmap.getHeight();
		canvas.drawText(String.format(Locale.getDefault(),
				"%d x %d Convert: %4.1f (ms)",
				width,height,periodConvert.getAverage()),
				0,120,paintText);
		canvas.drawText(String.format(Locale.getDefault(),
				"detector: %4.1f (ms)",timeDetection.getAverage()),
				180,170,paintText);


		// This line is magical and will save you hours/days of anguish
		// What it does is correctly convert the coordinate system from
		// image pixels that were processed into display coordinates
		// taking in account rotations and weird CCD layouts
		canvas.concat(imageToView);

		// Draw the bounding squares around the QR Codes
		synchronized (foundQR) {
			for (int foundIdx = 0; foundIdx < foundQR.size(); foundIdx++) {
				renderPolygon(foundQR.get(foundIdx),path,canvas,colorDetected);
			}
			if( foundQR.size() > 0 )
				textMessageView.setText(message);
		}

		// Pro tip: Run in app fast or release mode for a dramatic speed up!
		// In Android Studio expand "Build Variants" tab on left.
	}
1062442
function drawLoop () {
  ctx.clearRect(0, 0, canvas.width, canvas.height)

  var centerX = canvas.width / 2
  var centerY = canvas.height / 2

  // draw circle
  ctx.beginPath()
  ctx.arc(centerX, centerY, 100, 0, 2 * Math.PI, false)
  ctx.fillStyle = 'yellow'
  ctx.fill()

  // draw three oscilloscopes in different positions and colors
  ctx.strokeStyle = 'lime'
  scope.draw(ctx, 0, 0, centerX, centerY)

  ctx.strokeStyle = 'cyan'
  scope.draw(ctx, centerX, 0, centerX, centerY)

  ctx.strokeStyle = 'red'
  scope.draw(ctx, 0, centerY, null, centerY)

  window.requestAnimationFrame(drawLoop)
}
1174184
function() {
      WireIt.CanvasContainer.superclass.render.call(this);

		this.canvasEl = new WireIt.CanvasElement(this.bodyEl);
		this.canvasEl.SetCanvasRegion(0,0, this.width, this.height );
		this.canvasWidth = this.width;
		this.canvasHeight = this.height;
		this.drawCanvas();
   }
597451
@SuppressWarnings("deprecation")
    private void drawBackgroundProgress() {
        GradientDrawable backgroundDrawable = createGradientDrawable(colorBackground);
        int newRadius = radius - (padding / 2);
        backgroundDrawable.setCornerRadii(new float[]{newRadius, newRadius, newRadius, newRadius, newRadius, newRadius, newRadius, newRadius});
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            layoutBackground.setBackground(backgroundDrawable);
        } else {
            layoutBackground.setBackgroundDrawable(backgroundDrawable);
        }
    }
1099389
private void paintProgressIndicator(SeaGlassContext context, Graphics2D g2d, int width, int height, int size, boolean isFinished) {
        JProgressBar pBar = (JProgressBar) context.getComponent();

        if (tileWhenIndeterminate && pBar.isIndeterminate()) {
            double offsetFraction = (double) getAnimationIndex() / (double) getFrameCount();
            int offset = (int) (offsetFraction * tileWidth);
            if (pBar.getOrientation() == JProgressBar.HORIZONTAL) {
                // If we're right-to-left, flip the direction of animation.
                if (!SeaGlassLookAndFeel.isLeftToRight(pBar)) {
                    offset = tileWidth - offset;
                }
                // paint each tile horizontally
                for (int i = -tileWidth + offset; i <= width; i += tileWidth) {
                    context.getPainter().paintProgressBarForeground(context, g2d, i, 0, tileWidth, height, pBar.getOrientation());
                }
            } else {
                // paint each tile vertically
                for (int i = -offset; i < height + tileWidth; i += tileWidth) {
                    context.getPainter().paintProgressBarForeground(context, g2d, 0, i, width, tileWidth, pBar.getOrientation());
                }
            }
        } else {
            if (pBar.getOrientation() == JProgressBar.HORIZONTAL) {
                int start = 0;
                if (isFinished) {
                    size = width;
                } else if (!SeaGlassLookAndFeel.isLeftToRight(pBar)) {
                    start = width - size;
                }
                context.getPainter().paintProgressBarForeground(context, g2d, start, 0, size, height, pBar.getOrientation());
            } else {
                // When the progress bar is vertical we always paint from bottom
                // to top, not matter what the component orientation is.
                int start = height;
                if (isFinished) {
                    size = height;
                }
                context.getPainter().paintProgressBarForeground(context, g2d, 0, start, width, size, pBar.getOrientation());
            }
        }
    }
176783
@SuppressWarnings("deprecation")
    private void drawRoundedHole(Canvas canvas) {
        paint.setStyle(Paint.Style.FILL);
        paint.setColor(backColor);

        // Punching hole in background color requires offscreen drawing
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            canvas.saveLayer(0, 0, canvas.getWidth(), canvas.getHeight(), null);
        } else {
            canvas.saveLayer(0, 0, canvas.getWidth(), canvas.getHeight(), null, 0);
        }

        canvas.drawPaint(paint);

        final float rx = rounding * 0.5f * areaRect.width();
        final float ry = rounding * 0.5f * areaRect.height();
        canvas.drawRoundRect(areaRect, rx, ry, paintClear);

        canvas.restore();
    }
920717
@Override
    protected void onGraphDraw(Canvas _Canvas) {
        super.onGraphDraw(_Canvas);
        if(mUseOverlapFill) {
            mLinePaint.setStyle(Paint.Style.FILL);
        }
        else {
            mLinePaint.setStrokeWidth(mLineStroke);
            mLinePaint.setStyle(Paint.Style.STROKE);
        }

        _Canvas.concat(mDrawMatrix);
        if(mHasNegativeValues) {
            _Canvas.translate(0, -mNegativeOffset);
        }

        // drawing of lines
        for (ValueLineSeries series : mSeries) {
            mLinePaint.setColor(series.getColor());
            _Canvas.drawPath(series.getPath(), mLinePaint);
        }
    }
637002
private void drawCircleUp(@NonNull Canvas canvas, float step, float radius) {
    canvas.drawCircle(
            xCoordinate + step,
            getMeasuredHeight() / 2,
            dotRadius + radius,
            startPaint
    );
  }
1166320
@Override
    public void draw(Canvas canvas) {
        drawSpacings(canvas);
        drawBaselineGrid(canvas);
        drawKeylines(canvas);
    }
453274
private void drawEventsWithPlus(Canvas canvas, float xPosition, float yPosition, List<Event> eventsList) {
        // k = size() - 1, but since we don't want to draw more than 2 indicators, we just stop after 2 iterations so we can just hard k = -2 instead
        // we can use the below loop to draw arbitrary eventsByMonthAndYearMap based on the current screen size, for example, larger screens should be able to
        // display more than 2 evens before displaying plus indicator, but don't draw more than 3 indicators for now
        for (int j = 0, k = -2; j < 3; j++, k += 2) {
            Event event = eventsList.get(j);
            float xStartPosition = xPosition + (xIndicatorOffset * k);
            if (j == 2) {
                dayPaint.setColor(multiEventIndicatorColor);
                dayPaint.setStrokeWidth(multiDayIndicatorStrokeWidth);
                canvas.drawLine(xStartPosition - smallIndicatorRadius, yPosition, xStartPosition + smallIndicatorRadius, yPosition, dayPaint);
                canvas.drawLine(xStartPosition, yPosition - smallIndicatorRadius, xStartPosition, yPosition + smallIndicatorRadius, dayPaint);
                dayPaint.setStrokeWidth(0);
            } else {
                drawEventIndicatorCircle(canvas, xStartPosition, yPosition, event.getColor());
            }
        }
    }
273048
private void drawSlices(Canvas canvas) {
        final PieChartData data = dataProvider.getPieChartData();
        final float sliceScale = 360f / maxSum;
        float lastAngle = rotation;
        int sliceIndex = 0;
        for (SliceValue sliceValue : data.getValues()) {
            final float angle = Math.abs(sliceValue.getValue()) * sliceScale;
            if (isTouched() && selectedValue.getFirstIndex() == sliceIndex) {
                drawSlice(canvas, sliceValue, lastAngle, angle, MODE_HIGHLIGHT);
            } else {
                drawSlice(canvas, sliceValue, lastAngle, angle, MODE_DRAW);
            }
            lastAngle += angle;
            ++sliceIndex;
        }
    }
951081
public void drawFrame(int textureId, float[] texMatrix) {
        // Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport.
        mProgram.draw(IDENTITY_MATRIX, mRectDrawable.getVertexArray(), 0,
                mRectDrawable.getVertexCount(), mRectDrawable.getCoordsPerVertex(),
                mRectDrawable.getVertexStride(),
                texMatrix, TEX_COORDS_BUF, textureId, TEX_COORDS_STRIDE);
    }