Buffer rendering
544938
function renderObjectImmediate( object, program ) {

		object.render( function ( object ) {

			_this.renderBufferImmediate( object, program );

		} );

	}
1324516
def _display_buffer(self, buffer ):
        
        self._command([
            self.CMD_SSD1306_SET_COLUMN_ADDR,
            0, self.width-1,
            self.CMD_SSD1306_SET_PAGE_ADDR,
            0, self._mem_pages - 1
            ])
        self._data( buffer )
727977
def render_scene(self):
        ""
        self.init_gl() # should be a no-op after the first frame is rendered
        glfw.make_context_current(self.window)
        self.renderer.render_scene()
        # Done rendering
        # glfw.swap_buffers(self.window) # avoid double buffering to avoid stalling
        glFlush() # single buffering
        glfw.poll_events()
278314
private void buffer(byte b) {
        if (buffer.hasCapacity()) {
            buffer.put(b);
        } else {
            throw VFSMessages.MESSAGES.bufferDoesntHaveEnoughCapacity();
        }
    }
1215452
def save
      buffer = render

      File.open(path, 'wb') { |f| f.write(buffer.string) }
    end
406363
function toBuffer(data) {
  toBuffer.readOnly = true;

  if (Buffer.isBuffer(data)) return data;

  let buf;

  if (data instanceof ArrayBuffer) {
    buf = Buffer.from(data);
  } else if (ArrayBuffer.isView(data)) {
    buf = viewToBuffer(data);
  } else {
    buf = Buffer.from(data);
    toBuffer.readOnly = false;
  }

  return buf;
}
947137
function _reverseBuffer(buffer) {
        var tmp, len = buffer.length - 1, half = Math.floor(buffer.length / 2);
        for (var i = len; i >= half; i--) {
            tmp = buffer[i];
            buffer[i] = buffer[len - i];
            buffer[len - i] = tmp;
        }
    }
85731
def render
      buffer = ::Zip::OutputStream.write_buffer do |zip|
        render_package_relationships(zip)
        render_content_types(zip)
        render_app(zip)
        render_core(zip)
        render_custom(zip)
        render_fonts(zip)
        render_footer(zip)
        render_settings(zip)
        render_styles(zip)
        render_document(zip)
        render_relationships(zip)   # Must go here: Depends on document renderer
        render_media(zip)           # Must go here: Depends on document renderer
        render_numbering(zip)       # Must go here: Depends on document renderer
      end
    end
701372
function joinBuffers(buffers) {
		var
			i = -1, j = -1,
			num = buffers.length,
			totalBytes = 0,
			bytesWritten = 0,
			buff,
			superBuff
		;
		while (++i < num) {
			totalBytes += buffers[i].length;
		}
		superBuff = new Buffer(totalBytes);
		while (++j < num) {
			buff = buffers[j];
			buff.copy(superBuff, bytesWritten, 0);
			bytesWritten += buff.length;
		}
		return superBuff;
	}
548335
def __render(self):
		

		# Render first frame
		self.__render_videoframe()

		# Start videoclock with start of this thread
		self.clock.start()

		logger.debug("Started rendering loop.")
		# Main rendering loop
		while self.status in [PLAYING,PAUSED]:
			current_frame_no = self.clock.current_frame

			# Check if end of clip has been reached
			if self.clock.time >= self.duration:
				logger.debug("End of stream reached at {}".format(self.clock.time))
				if self.loop:
					logger.debug("Looping: restarting stream")
					# Seek to the start
					self.rewind()
					self.loop_count += 1
				else:
					# End of stream has been reached
					self.status = EOS
					break

			if self.last_frame_no != current_frame_no:
				# A new frame is available. Get it from te stream
				self.__render_videoframe()

			self.last_frame_no = current_frame_no

			# Sleeping is a good idea to give the other threads some breathing
			# space to do their work.
			time.sleep(0.005)

		# Stop the clock.
		self.clock.stop()
		logger.debug("Rendering stopped.")
251267
function writeBuffer() {
      fs.write(fd, buff, 0, buff.length, 0, function (error) {
        fs.close(fd);

        callback(error);
      });
    }
648193
def render_image(self, rgbobj, dst_x, dst_y):
        
        if self.surface is None:
            return
        self.logger.debug("redraw surface")

        # get window contents as a buffer and load it into the AGG surface
        rgb_buf = self.viewer.getwin_buffer(order=self.rgb_order,
                                            dtype=np.uint8)
        self.surface.frombytes(rgb_buf)
886700
private static void renderY(Graphic g, CollisionFunction function, CollisionRange range, int th, int x)
    {
        if (UtilMath.isBetween(x, range.getMinX(), range.getMaxX()))
        {
            g.drawRect(x, th - function.getRenderY(x) - 1, 0, 0, false);
        }
    }
776133
public void render() {
		if ((engine.usePoints() && (usePoints == INHERIT_POINTS))
				|| (usePoints == USE_POINTS)) {
			TextureImpl.bindNone();
			GL.glEnable(SGL.GL_POINT_SMOOTH);
			GL.glPointSize(size / 2);
			color.bind();
			GL.glBegin(SGL.GL_POINTS);
			GL.glVertex2f(x, y);
			GL.glEnd();
		} else if (oriented || scaleY != 1.0f) {
			GL.glPushMatrix();

			GL.glTranslatef(x, y, 0f);

			if (oriented) {
				float angle = (float) (Math.atan2(y, x) * 180 / Math.PI);
				GL.glRotatef(angle, 0f, 0f, 1.0f);
			}

			// scale
			GL.glScalef(1.0f, scaleY, 1.0f);

			image.draw((int) (-(size / 2)), (int) (-(size / 2)), (int) size,
					(int) size, color);
			GL.glPopMatrix();
		} else {
			color.bind();
			image.drawEmbedded((int) (x - (size / 2)), (int) (y - (size / 2)),
					(int) size, (int) size);
		}
	}
808915
function (buffer) {
        var header = new Uint32Array(buffer, 0, 4);
        if (header[0] !== 0x46546C67) {
            this.trigger('error', 'Invalid glTF binary format: Invalid header');
            return;
        }
        if (header[0] < 2) {
            this.trigger('error', 'Only glTF2.0 is supported.');
            return;
        }

        var dataView = new DataView(buffer, 12);

        var json;
        var buffers = [];
        // Read chunks
        for (var i = 0; i < dataView.byteLength;) {
            var chunkLength = dataView.getUint32(i, true);
            i += 4;
            var chunkType = dataView.getUint32(i, true);
            i += 4;

            // json
            if (chunkType === 0x4E4F534A) {
                var arr = new Uint8Array(buffer, i + 12, chunkLength);
                // TODO, for the browser not support TextDecoder.
                var decoder = new TextDecoder();
                var str = decoder.decode(arr);
                try {
                    json = JSON.parse(str);
                }
                catch (e) {
                    this.trigger('error', 'JSON Parse error:' + e.toString());
                    return;
                }
            }
            else if (chunkType === 0x004E4942) {
                buffers.push(buffer.slice(i + 12, i + 12 + chunkLength));
            }

            i += chunkLength;
        }
        if (!json) {
            this.trigger('error', 'Invalid glTF binary format: Can\'t find JSON.');
            return;
        }

        return this.parse(json, buffers);
    }
459980
function createVertexBufferObjects(renderState) {
    if (m_geomData) {
      if (renderState) {
        m_context = renderState.m_context;
      }
      var numberOfSources = m_geomData.numberOfSources(),
          i, j, k, bufferId = null, keys, ks, numberOfPrimitives, data;

      for (i = 0; i < numberOfSources; i += 1) {
        bufferId = m_context.createBuffer();
        m_context.bindBuffer(vgl.GL.ARRAY_BUFFER, bufferId);
        data = m_geomData.source(i).data();
        if (!(data instanceof Float32Array)) {
          data = new Float32Array(data);
        }
        m_context.bufferData(vgl.GL.ARRAY_BUFFER, data,
                      m_dynamicDraw ? vgl.GL.DYNAMIC_DRAW :
                      vgl.GL.STATIC_DRAW);

        keys = m_geomData.source(i).keys();
        ks = [];

        for (j = 0; j < keys.length; j += 1) {
          ks.push(keys[j]);
        }

        m_bufferVertexAttributeMap[i] = ks;
        m_buffers[i] = bufferId;
      }

      numberOfPrimitives = m_geomData.numberOfPrimitives();
      for (k = 0; k < numberOfPrimitives; k += 1) {
        bufferId = m_context.createBuffer();
        m_context.bindBuffer(vgl.GL.ARRAY_BUFFER, bufferId);
        m_context.bufferData(vgl.GL.ARRAY_BUFFER,
          m_geomData.primitive(k).indices(), vgl.GL.STATIC_DRAW);
        m_buffers[i] = bufferId;
        i += 1;
      }

      m_glCompileTimestamp.modified();
    }
  }
672104
function render (currentTime) {
      // Store time scroll started, if not started already:
      if (!startTime) {
        startTime = currentTime;
      }

      // Determine time spent scrolling so far:
      elapsedTime = currentTime - startTime;

      // Calculate next scroll position:
      next = easing(elapsedTime, start, distance, duration, settings);

      // Scroll to it:
      window.scrollTo(0, next);

      // Check progress:
      elapsedTime < duration
        ? window.requestAnimationFrame(render)
        : done(start, startTime, distance, settings);
    }