Render and draw updated **dynamic** electrode actuations layer on
        canvas.


        .. versionadded:: 0.12
975835
def on_dynamic_electrode_states_set(self, states):
        '''
        
        '''
        self.canvas_slave._dynamic_electrodes = states

        surface = self.canvas_slave.render_dynamic_electrode_state_shapes()
        self.canvas_slave.set_surface('dynamic_electrode_state_shapes',
                                      surface)
        self.canvas_slave.cairo_surface = flatten_surfaces(self.canvas_slave
                                                           .df_surfaces)
        gobject.idle_add(self.canvas_slave.draw)
28994
def _updateCanvasDraw(self):
        
        fn = self.canvas.draw
        def draw2(*a,**k):
            self._updateGridSpec()
            return fn(*a,**k)
        self.canvas.draw = draw2
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.
	}
100101
def _push_render(self):
        
        bokeh.io.push_notebook(handle=self.handle)
        self.last_update = time.time()
554954
protected void onDrawFrame( SurfaceView view , Canvas canvas ) {

		// Code below is usefull when debugging display issues
//		Paint paintFill = new Paint();
//		paintFill.setColor(Color.RED);
//		paintFill.setStyle(Paint.Style.FILL);
//		Paint paintBorder = new Paint();
//		paintBorder.setColor(Color.BLUE);
//		paintBorder.setStyle(Paint.Style.STROKE);
//		paintBorder.setStrokeWidth(6*displayMetrics.density);
//
//		Rect r = new Rect(0,0,view.getWidth(),view.getHeight());
//		canvas.drawRect(r,paintFill);
//		canvas.drawRect(r,paintBorder);
		switch( bitmapMode) {
			case UNSAFE:
				canvas.drawBitmap(this.bitmap, imageToView, null);
				break;

			case DOUBLE_BUFFER:
				bitmapLock.lock();
				try{
					canvas.drawBitmap(this.bitmap, imageToView, null);
				} finally {
					bitmapLock.unlock();
				}
				break;
		}
	}
1176724
def draw(self, milliseconds, surface):
        """"""
        super(CollidableObj, self).draw(milliseconds, surface)
1226327
def draw(self):
        
        self.update_all()
        self.vertex_list.draw(self.gl)
        pyglet.gl.glLoadIdentity()
1363293
def render_electrode_shapes(self, df_shapes=None, shape_scale=0.8,
                                fill=(1, 1, 1)):
        '''
        
        '''
        surface = self.get_surface()
        if df_shapes is None:
            if hasattr(self.canvas, 'df_canvas_shapes'):
                df_shapes = self.canvas.df_canvas_shapes
            else:
                return surface
        if 'x_center' not in df_shapes or 'y_center' not in df_shapes:
            # No center points have been computed for shapes.
            return surface

        cairo_context = cairo.Context(surface)

        df_shapes = df_shapes.copy()
        # Scale shapes to leave shape edges uncovered.
        df_shapes[['x', 'y']] = (df_shapes[['x_center', 'y_center']] +
                                 df_shapes[['x_center_offset',
                                            'y_center_offset']].values *
                                 shape_scale)

        for path_id, df_path_i in (df_shapes.groupby(self.canvas
                                                     .shape_i_columns)[['x',
                                                                        'y']]):
            # Use attribute lookup for `x` and `y`, since it is considerably
            # faster than `get`-based lookup using columns name strings.
            vertices_x = df_path_i.x.values
            vertices_y = df_path_i.y.values
            cairo_context.move_to(vertices_x[0], vertices_y[0])
            for x, y in itertools.izip(vertices_x[1:], vertices_y[1:]):
                cairo_context.line_to(x, y)
            cairo_context.close_path()

            # Draw filled shape to indicate actuated electrode state.
            cairo_context.set_source_rgba(*fill)
            cairo_context.fill()
        return surface
1287546
def Draw(self, dc):
        '''  '''
        self.hot_map = []
        dc.BeginDrawing()
        brush = wx.Brush( self.BackgroundColour  )
        dc.SetBackground( brush )
        dc.Clear()
        if self.model:
            self.max_depth_seen = 0
            font = self.FontForLabels(dc)
            dc.SetFont(font)
            self._em_size_ = dc.GetFullTextExtent( 'm', font )[0]
            w, h = dc.GetSize()
            self.DrawBox( dc, self.model, 0,0,w,h, hot_map = self.hot_map )
        dc.EndDrawing()
14983
@Override
  public void onDraw() {
    // draw is only expected if the controller is attached
    if (mIsControllerAttached) {
      return;
    }

    // something went wrong here; controller is not attached, yet the hierarchy has to be drawn
    // log error and attach the controller
    FLog.w(
        DraweeEventTracker.class,
        "%x: Draw requested for a non-attached controller %x. %s",
        System.identityHashCode(this),
        System.identityHashCode(mController),
        toString());

    mIsHolderAttached = true;
    mIsVisible = true;
    attachOrDetachController();
  }
195495
def draw(self):
        
        if not self.visible:
            return

        # Blit the button's current appearance to the surface.
        if self.isEnabled:
            if self.mouseIsDown:
                if self.mouseOverButton and self.lastMouseDownOverButton:
                    self.window.blit(self.surfaceDown, self.loc)
                else:
                    self.window.blit(self.surfaceUp, self.loc)
            else:  # mouse is up
                if self.mouseOverButton:
                    self.window.blit(self.surfaceOver, self.loc)
                else:
                    self.window.blit(self.surfaceUp, self.loc)

        else:
            self.window.blit(self.surfaceDisabled, self.loc)
220582
function (renderer, layer, rect) {
            var tile;

            // get top-left and bottom-right tile position
            var startTile = this.pixelToTileCoords(
                rect.pos.x,
                rect.pos.y,
                me.pool.pull("me.Vector2d")
            );

            // Compensate for the layer position
            startTile.sub(layer.pos);

            // get top-left and bottom-right tile position
            var startPos = this.tileToPixelCoords(
                startTile.x + layer.pos.x,
                startTile.y + layer.pos.y,
                me.pool.pull("me.Vector2d")
            );

            var rowTile = startTile.clone();
            var rowPos = startPos.clone();

           /* Determine in which half of the tile the top-left corner of the area we
            * need to draw is. If we're in the upper half, we need to start one row
            * up due to those tiles being visible as well. How we go up one row
            * depends on whether we're in the left or right half of the tile.
            */
            var inUpperHalf = rect.pos.y - startPos.y < this.sideoffsety;
            var inLeftHalf = rect.pos.x - startPos.x < this.sideoffsetx;

            if (inUpperHalf) {
                startTile.y--;
            }
            if (inLeftHalf) {
                startTile.x--;
            }

            var endX = layer.cols;
            var endY = layer.rows;

            if (this.staggerX) {
                //ensure we are in the valid tile range
                startTile.x = Math.max(0, startTile.x);
                startTile.y = Math.max(0, startTile.y);

                startPos = this.tileToPixelCoords(
                    startTile.x + layer.pos.x,
                    startTile.y + layer.pos.y
                );

                var staggeredRow = this.doStaggerX(startTile.x + layer.pos.x);

                // main drawing loop
                for (; startPos.y < rect.bottom && startTile.y < endY; ) {
                    rowTile.setV(startTile);
                    rowPos.setV(startPos);

                    for (; rowPos.x < rect.right && rowTile.x < endX; rowTile.x+=2) {
                        tile = layer.layerData[rowTile.x][rowTile.y];
                        if (tile) {
                            // draw the tile
                            tile.tileset.drawTile(renderer, rowPos.x, rowPos.y, tile);
                        }
                        rowPos.x += this.tilewidth + this.sidelengthx;
                    }

                    if (staggeredRow) {
                        startTile.x -= 1;
                        startTile.y += 1;
                        startPos.x -= this.columnwidth;
                        staggeredRow = false;
                    } else {
                        startTile.x += 1;
                        startPos.x += this.columnwidth;
                        staggeredRow = true;
                    }

                    startPos.y += this.rowheight;
                }
                me.pool.push(rowTile);
                me.pool.push(rowPos);

            } else {
                //ensure we are in the valid tile range
                startTile.x = Math.max(0, startTile.x);
                startTile.y = Math.max(0, startTile.y);

                startPos = this.tileToPixelCoords(
                    startTile.x + layer.pos.x,
                    startTile.y + layer.pos.y
                );

                // Odd row shifting is applied in the rendering loop, so un-apply it here
                if (this.doStaggerY(startTile.y)) {
                    startPos.x -= this.columnwidth;
                }

                // main drawing loop
                for (; startPos.y < rect.bottom && startTile.y < endY; startTile.y++) {
                    rowTile.setV(startTile);
                    rowPos.setV(startPos);

                    if (this.doStaggerY(startTile.y)) {
                        rowPos.x += this.columnwidth;
                    }

                    for (; rowPos.x < rect.right && rowTile.x < endX; rowTile.x++) {
                        tile = layer.layerData[rowTile.x][rowTile.y];
                        if (tile) {
                            // draw the tile
                            tile.tileset.drawTile(renderer, rowPos.x, rowPos.y, tile);
                        }
                        rowPos.x += this.tilewidth + this.sidelengthx;
                    }
                    startPos.y += this.rowheight;
                }
                me.pool.push(rowTile);
                me.pool.push(rowPos);
            }

            me.pool.push(startTile);
            me.pool.push(startPos);
        }
785793
function() {
        var gl = this.context;
        gl.bindBuffer(gl.ARRAY_BUFFER, this._attributeBuffer);
        gl.bufferData(gl.ARRAY_BUFFER, this._attributeArray, gl.STATIC_DRAW);
        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._indexBuffer);
        gl.bufferData(
            gl.ELEMENT_ARRAY_BUFFER,
            this._indexArray,
            gl.STATIC_DRAW
        );
        gl.drawElements(gl.TRIANGLES, this.index_pointer, gl.UNSIGNED_SHORT, 0);
    }
1258345
function() {
		if ( !this.force2D && WebGLRenderer.isSupported( this.el ) ) {
			this.renderer = new WebGLRenderer( this.el );
		} else if ( Canvas2DRenderer.isSupported( this.el ) ) {
			this.renderer = new Canvas2DRenderer( this.el );
		} else {
			throw new Error( "No supported renderer!" );
		}
	}
1284853
function draw(attrsModified) {
    calc();
    if (isChanged && value != prevValue)
      slider.dispatchEvent(onChange);
    isChanged = false;
    if (!attrsModified && value == prevValue)
      return;
    prevValue = value;
    var position = range ? (value - min) / range * 100 : 0;
    var bg = '-moz-element(#__sliderthumb__) ' + position + '% no-repeat, ';
    style(slider, { background: bg + track });
  }
735802
function drawFX(renderer) {
         // fading effect
         if (this._fadeIn.tween) {
           renderer.clearColor(this._fadeIn.color); // remove the tween if over

           if (this._fadeIn.color.alpha === 1.0) {
             this._fadeIn.tween = null;
             me.pool.push(this._fadeIn.color);
             this._fadeIn.color = null;
           }
         } // flashing effect


         if (this._fadeOut.tween) {
           renderer.clearColor(this._fadeOut.color); // remove the tween if over

           if (this._fadeOut.color.alpha === 0.0) {
             this._fadeOut.tween = null;
             me.pool.push(this._fadeOut.color);
             this._fadeOut.color = null;
           }
         }
       }
1299995
function() {
        var width = canvasWidth,
          height = canvasHeight,
          positionX = canvasWidth / 2,
          positionY = canvasHeight / 2,
          alphaPercentage = (width / 100) * self.currentPercentage;

        //clearing canvas from everithing
        clear();
        //let's start drawning
        ctx.restore();
        ctx.beginPath();
        //draw percentage text
        ctx.font = font;
        ctx.fillStyle = color;
        ctx.textAlign = "center";
        ctx.fillText((self.currentPercentage | 0) + "%", positionX, positionY - (lineWidth + 10));
        //width of the preloader line
        ctx.lineWidth = lineWidth;
        //color of preloader line
        ctx.strokeStyle = color;
        if (glowColor) {
          ctx.shadowOffsetX = 0;
          ctx.shadowOffsetY = 0;
          ctx.shadowBlur = 10;
          ctx.shadowColor = glowColor;
        }
        ctx.moveTo(positionX - (width / 2), positionY);
        ctx.lineTo(alphaPercentage, positionY);
        ctx.stroke();

        ctx.save();
      }