Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions artpaint/paintwindow/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1490,28 +1490,11 @@ Image::DoRenderPreview(BRect area, int32 resolution)
int32 right = (int32)area.right;
int32 bottom = (int32)area.bottom;

int32 gridSize;
uint32 color1;
uint32 color2;

gridSize = 20;
rgb_color rgb1, rgb2;
rgb1.red = rgb1.green = rgb1.blue = 0xBB;
rgb2.red = rgb2.green = rgb2.blue = 0x99;
rgb1.alpha = rgb2.alpha = 0xFF;
color1 = RGBColorToBGRA(rgb1);
color2 = RGBColorToBGRA(rgb2);
union color_conversion white_bg;
white_bg.word = 0xFFFFFFFF;
white_bg.bytes[3] = 0x00;

if (SettingsServer* server = SettingsServer::Instance()) {
BMessage settings;
server->GetApplicationSettings(&settings);

gridSize = settings.GetInt32(skBgGridSize, gridSize);
color1 = settings.GetUInt32(skBgColor1, color1);
color2 = settings.GetUInt32(skBgColor2, color2);
}

BitmapUtilities::CheckerBitmap(rendered_image, color1, color2, gridSize, &area);
BitmapUtilities::ClearBitmap(rendered_image, white_bg.word, &area);

for (int32 y = top; y <= bottom; y += resolution) {
for (int32 x = left; x <= right; x += resolution) {
Expand Down
4 changes: 2 additions & 2 deletions artpaint/paintwindow/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class Image {
Image(ImageView*, float, float, UndoQueue*);
~Image();

void Render(bool bg = true);
void Render(BRect, bool bg = true);
void Render(bool bg = false);
void Render(BRect, bool bg = false);
void RenderPreview(BRect, int32);
void RenderPreview(BRegion&, int32);
void MultiplyRenderedImagePixels(int32);
Expand Down
Loading