summaryrefslogtreecommitdiff
path: root/libs/litehtml/containers/test
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-03-30 19:43:42 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-03-30 19:43:42 +0300
commit032787f69076aafd43843c9ab64bdc373dc9aa6a (patch)
treee8d761cf9adbf492ab2d249d9fc427be7660ca66 /libs/litehtml/containers/test
parent79353069a2cc268c37c3bf8c50e8d74039298231 (diff)
update of litehtml, fixes the problem with empty lines
Diffstat (limited to 'libs/litehtml/containers/test')
-rw-r--r--libs/litehtml/containers/test/Bitmap.cpp14
-rw-r--r--libs/litehtml/containers/test/test_container.cpp4
-rw-r--r--libs/litehtml/containers/test/test_container.h6
3 files changed, 14 insertions, 10 deletions
diff --git a/libs/litehtml/containers/test/Bitmap.cpp b/libs/litehtml/containers/test/Bitmap.cpp
index 862d4844e7..169b50e091 100644
--- a/libs/litehtml/containers/test/Bitmap.cpp
+++ b/libs/litehtml/containers/test/Bitmap.cpp
@@ -36,12 +36,12 @@ void Bitmap::draw_line(int x0, int y0, int x1, int y1, web_color color)
}
}
-void Bitmap::draw_rect(int x, int y, int width, int height, web_color color)
+void Bitmap::draw_rect(int x, int y, int _width, int _height, web_color color)
{
- draw_line(x, y, x + width, y, color); // top
- draw_line(x, y + height - 1, x + width, y + height - 1, color); // bottom
- draw_line(x, y, x, y + height, color); // left
- draw_line(x + width - 1, y, x + width - 1, y + height, color); // right
+ draw_line(x, y, x + _width, y, color); // top
+ draw_line(x, y + _height - 1, x + _width, y + _height - 1, color); // bottom
+ draw_line(x, y, x, y + _height, color); // left
+ draw_line(x + _width - 1, y, x + _width - 1, y + _height, color); // right
}
void Bitmap::fill_rect(position rect, web_color color)
@@ -112,7 +112,7 @@ void Bitmap::resize(int new_width, int new_height)
void Bitmap::load(string filename)
{
- vector<byte> image;
+ vector<unsigned char> image;
unsigned w, h;
lodepng::decode(image, w, h, filename);
if (w * h == 0) return;
@@ -125,5 +125,5 @@ void Bitmap::load(string filename)
void Bitmap::save(string filename)
{
- lodepng::encode(filename, (byte*)data.data(), width, height);
+ lodepng::encode(filename, (unsigned char*)data.data(), width, height);
}
diff --git a/libs/litehtml/containers/test/test_container.cpp b/libs/litehtml/containers/test/test_container.cpp
index 9522b577e3..45577106c6 100644
--- a/libs/litehtml/containers/test/test_container.cpp
+++ b/libs/litehtml/containers/test/test_container.cpp
@@ -41,10 +41,10 @@ int test_container::pt_to_px(int pt) const { return pt * 96 / 72; }
int test_container::get_default_font_size() const { return 16; }
const char* test_container::get_default_font_name() const { return ""; }
-void test_container::draw_background(uint_ptr hdc, const std::vector<background_paint>& bg)
+void test_container::draw_solid_fill(litehtml::uint_ptr hdc, const background_layer& layer, const web_color& color)
{
auto bmp = (Bitmap*)hdc;
- bmp->fill_rect(bg.back().border_box, bg.back().color);
+ bmp->fill_rect(layer.border_box, color);
}
void test_container::draw_borders(uint_ptr hdc, const borders& borders, const position& pos, bool /*root*/)
diff --git a/libs/litehtml/containers/test/test_container.h b/libs/litehtml/containers/test/test_container.h
index 390ad45492..45a452a609 100644
--- a/libs/litehtml/containers/test/test_container.h
+++ b/libs/litehtml/containers/test/test_container.h
@@ -19,7 +19,11 @@ public:
const char* get_default_font_name() const override;
void load_image(const char* /*src*/, const char* /*baseurl*/, bool /*redraw_on_ready*/) override {}
void get_image_size(const char* /*src*/, const char* /*baseurl*/, size& /*sz*/) override {}
- void draw_background(uint_ptr hdc, const std::vector<background_paint>& bg) override;
+ void draw_image(litehtml::uint_ptr /*hdc*/, const background_layer& /*layer*/, const std::string& /*url*/, const std::string& /*base_url*/) override {};
+ void draw_solid_fill(litehtml::uint_ptr hdc, const background_layer& layer, const web_color& color) override;
+ void draw_linear_gradient(litehtml::uint_ptr /*hdc*/, const background_layer& /*layer*/, const background_layer::linear_gradient& /*gradient*/) override {};
+ void draw_radial_gradient(litehtml::uint_ptr /*hdc*/, const background_layer& /*layer*/, const background_layer::radial_gradient& /*gradient*/) override {};
+ void draw_conic_gradient(litehtml::uint_ptr /*hdc*/, const litehtml::background_layer& /*layer*/, const litehtml::background_layer::conic_gradient& /*gradient*/) override {};
void draw_borders(uint_ptr hdc, const borders& borders, const position& draw_pos, bool root) override;
void draw_list_marker(uint_ptr hdc, const list_marker& marker) override;
element::ptr create_element(const char* /*tag_name*/,