/// Flush the contents of this context to the browser's 3D device. void OpenGLContext::FlushContext() { if(flush_pending()) { // A flush is pending so do nothing; just drop this flush on the floor. return; } set_flush_pending(true); context_.SwapBuffers(pp::CompletionCallback(&FlushCallback, this)); }
void GboxInstance::FlushPixelBuffer() { if (!IsContextValid()) return; // Note that the pixel lock is held while the buffer is copied into the // device context and then flushed. m_board->redraw((uint32_t*)pixel_buffer_->data()); graphics_2d_context_->PaintImageData(*pixel_buffer_, pp::Point()); if (flush_pending()) return; set_flush_pending(true); graphics_2d_context_->Flush(pp::CompletionCallback(&FlushCallback, this)); }
void OpenGLContext::FlushContext() { if (flush_pending()) { // A flush is pending so do nothing; just drop this flush on the floor. return; } set_flush_pending(true); OSNacl* os = (OSNacl*)OS::get_singleton(); MakeContextCurrent(instance); os->iterate(); context_.SwapBuffers(pp::CompletionCallback(&FlushCallback, this)); }