Exemple #1
0
void
RawBitmap::StretchTo(unsigned width, unsigned height,
                     Canvas &dest_canvas,
                     unsigned dest_width, unsigned dest_height,
                     gcc_unused bool transparent_white) const
{
  GLTexture &texture = BindAndGetTexture();

  OpenGL::texture_shader->Use();

  texture.Draw(PixelRect(0, 0, dest_width, dest_height),
               PixelRect(0, 0, width, height));
}
Exemple #2
0
void
RawBitmap::StretchTo(unsigned width, unsigned height,
                     Canvas &dest_canvas,
                     unsigned dest_width, unsigned dest_height) const
{
  GLTexture &texture = BindAndGetTexture();

#ifdef USE_GLSL
  OpenGL::texture_shader->Use();
#else
  const GLEnable<GL_TEXTURE_2D> scope;
  OpenGL::glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
#endif

  texture.Draw(0, 0, dest_width, dest_height, 0, 0, width, height);
}