mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 08:27:46 +00:00
Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
This commit is contained in:
parent
7dc3a5ce3f
commit
6dc2c38fd0
10 changed files with 105 additions and 112 deletions
|
@ -24,6 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/Endian.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/MappedFile.h>
|
||||
|
@ -41,8 +42,6 @@
|
|||
# include <serenity.h>
|
||||
#endif
|
||||
|
||||
//#define PNG_DEBUG
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
static const u8 png_header[8] = { 0x89, 'P', 'N', 'G', 13, 10, 26, 10 };
|
||||
|
@ -614,9 +613,7 @@ static bool decode_png_bitmap_simple(PNGLoadingContext& context)
|
|||
}
|
||||
|
||||
if (filter > 4) {
|
||||
#ifdef PNG_DEBUG
|
||||
dbg() << "Invalid PNG filter: " << filter;
|
||||
#endif
|
||||
dbgln<debug_png>("Invalid PNG filter: {}", filter);
|
||||
context.state = PNGLoadingContext::State::Error;
|
||||
return false;
|
||||
}
|
||||
|
@ -718,9 +715,7 @@ static bool decode_adam7_pass(PNGLoadingContext& context, Streamer& streamer, in
|
|||
}
|
||||
|
||||
if (filter > 4) {
|
||||
#ifdef PNG_DEBUG
|
||||
dbg() << "Invalid PNG filter: " << filter;
|
||||
#endif
|
||||
dbgln<debug_png>("Invalid PNG filter: {}", filter);
|
||||
context.state = PNGLoadingContext::State::Error;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "FontDatabase.h"
|
||||
#include "Gamma.h"
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/Memory.h>
|
||||
#include <AK/QuickSort.h>
|
||||
|
@ -915,9 +916,7 @@ void Painter::draw_glyph_or_emoji(const IntPoint& point, u32 code_point, const F
|
|||
// Perhaps it's an emoji?
|
||||
auto* emoji = Emoji::emoji_for_code_point(code_point);
|
||||
if (emoji == nullptr) {
|
||||
#ifdef EMOJI_DEBUG
|
||||
dbg() << "Failed to find an emoji for code_point " << code_point;
|
||||
#endif
|
||||
dbgln<debug_emoji>("Failed to find an emoji for code_point {}", code_point);
|
||||
draw_glyph(point, '?', font, color);
|
||||
return;
|
||||
}
|
||||
|
@ -1632,9 +1631,8 @@ void Painter::fill_path(Path& path, Color color, WindingRule winding_rule)
|
|||
if (is_inside_shape(winding_number)) {
|
||||
// The points between this segment and the previous are
|
||||
// inside the shape
|
||||
#ifdef FILL_PATH_DEBUG
|
||||
dbg() << "y=" << scanline << ": " << winding_number << " at " << i << ": " << from << " -- " << to;
|
||||
#endif
|
||||
|
||||
dbgln<debug_fill_path>("y={}: {} at {}: {} -- {}", scanline, winding_number, i, from, to);
|
||||
draw_line(from, to, color, 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Array.h>
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/Endian.h>
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/MappedFile.h>
|
||||
|
@ -41,8 +42,6 @@
|
|||
#include <LibGfx/ImageDecoder.h>
|
||||
#include <LibGfx/Streamer.h>
|
||||
|
||||
//#define PORTABLE_IMAGE_LOADER_DEBUG
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
static constexpr Color adjust_color(u16 max_val, Color color)
|
||||
|
@ -105,18 +104,14 @@ static bool read_magic_number(TContext& context, Streamer& streamer)
|
|||
|
||||
if (!context.data || context.data_size < 2) {
|
||||
context.state = TContext::State::Error;
|
||||
#ifdef PORTABLE_IMAGE_LOADER_DEBUG
|
||||
dbg() << "There is no enough data for " << TContext::image_type;
|
||||
#endif
|
||||
dbgln<debug_portable_image_loader>("There is no enough data for {}", TContext::image_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
u8 magic_number[2] {};
|
||||
if (!streamer.read_bytes(magic_number, 2)) {
|
||||
context.state = TContext::State::Error;
|
||||
#ifdef PORTABLE_IMAGE_LOADER_DEBUG
|
||||
dbg() << "We can't read magic number for " << TContext::image_type;
|
||||
#endif
|
||||
dbgln<debug_portable_image_loader>("We can't read magic number for {}", TContext::image_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -133,10 +128,7 @@ static bool read_magic_number(TContext& context, Streamer& streamer)
|
|||
}
|
||||
|
||||
context.state = TContext::State::Error;
|
||||
#ifdef PORTABLE_IMAGE_LOADER_DEBUG
|
||||
dbg() << "Magic number is not valid for "
|
||||
<< magic_number[0] << magic_number[1] << TContext::image_type;
|
||||
#endif
|
||||
dbgln<debug_portable_image_loader>("Magic number is not valid for {}{}{}", magic_number[0], magic_number[1], TContext::image_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -194,9 +186,7 @@ static bool read_max_val(TContext& context, Streamer& streamer)
|
|||
}
|
||||
|
||||
if (context.max_val > 255) {
|
||||
#ifdef PORTABLE_IMAGE_LOADER_DEBUG
|
||||
dbg() << "We can't parse 2 byte color for " << TContext::image_type;
|
||||
#endif
|
||||
dbgln<debug_portable_image_loader>("We can't parse 2 byte color for {}", TContext::image_type);
|
||||
context.state = TContext::Error;
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue