GUI2/Canvas: renamed blit function and removed surface argument

This commit is contained in:
Charles Dang 2017-05-31 01:13:27 +11:00
parent c6ed3f018e
commit c926ce76e0
4 changed files with 9 additions and 13 deletions

View file

@ -1476,7 +1476,7 @@ void canvas::draw(const bool force)
is_dirty_ = false;
}
void canvas::blit(surface& /*surf*/, SDL_Rect rect)
void canvas::render(SDL_Rect rect)
{
SDL_RenderSetViewport(renderer_, &rect);

View file

@ -102,15 +102,14 @@ public:
void draw(const bool force = false);
/**
* Blits the canvas unto another surface.
* Copies the canvas texture to the screen renderer.
*
* It makes sure the image on the canvas is up to date. Also executes the
* pre-blitting functions.
*
* @param surf The surface to blit upon.
* @param rect The place to blit to.
*/
void blit(surface& surf, SDL_Rect rect);
void render(SDL_Rect rect);
/**
* Sets the config.

View file

@ -64,20 +64,18 @@ unsigned panel::get_state() const
return 0;
}
void panel::impl_draw_background(surface& frame_buffer, int x_offset, int y_offset)
void panel::impl_draw_background(surface& /*frame_buffer*/, int x_offset, int y_offset)
{
DBG_GUI_D << LOG_HEADER << " size " << get_rectangle() << ".\n";
get_canvas(0).blit(frame_buffer,
calculate_blitting_rectangle(x_offset, y_offset));
get_canvas(0).render(calculate_blitting_rectangle(x_offset, y_offset));
}
void panel::impl_draw_foreground(surface& frame_buffer, int x_offset, int y_offset)
void panel::impl_draw_foreground(surface& /*frame_buffer*/, int x_offset, int y_offset)
{
DBG_GUI_D << LOG_HEADER << " size " << get_rectangle() << ".\n";
get_canvas(1).blit(frame_buffer,
calculate_blitting_rectangle(x_offset, y_offset));
get_canvas(1).render(calculate_blitting_rectangle(x_offset, y_offset));
}
point panel::border_space() const

View file

@ -408,15 +408,14 @@ int styled_widget::get_text_maximum_height() const
return get_height() - config_->text_extra_height;
}
void styled_widget::impl_draw_background(surface& frame_buffer,
void styled_widget::impl_draw_background(surface& /*frame_buffer*/,
int x_offset,
int y_offset)
{
DBG_GUI_D << LOG_HEADER << " label '" << debug_truncate(label_) << "' size "
<< get_rectangle() << ".\n";
get_canvas(get_state()).blit(frame_buffer,
calculate_blitting_rectangle(x_offset, y_offset));
get_canvas(get_state()).render(calculate_blitting_rectangle(x_offset, y_offset));
}
void styled_widget::impl_draw_foreground(surface& /*frame_buffer*/