LibWeb: Hide some debug logging behind CANVAS_RENDERING_CONTEXT_2D_DEBUG

This can be quite noisy and isn't generally useful information.
This commit is contained in:
Linus Groh 2022-03-04 18:50:23 +01:00 committed by Andreas Kling
parent a2e6abe159
commit 1719862d12
Notes: sideshowbarker 2024-07-17 17:56:24 +09:00
3 changed files with 9 additions and 3 deletions

View File

@ -26,6 +26,10 @@
#cmakedefine01 CALLBACK_MACHINE_DEBUG
#endif
#ifndef CANVAS_RENDERING_CONTEXT_2D_DEBUG
#cmakedefine01 CANVAS_RENDERING_CONTEXT_2D_DEBUG
#endif
#ifndef COMPOSE_DEBUG
#cmakedefine01 COMPOSE_DEBUG
#endif

View File

@ -11,6 +11,7 @@ set(BMP_DEBUG ON)
set(BXVGA_DEBUG ON)
set(CACHE_DEBUG ON)
set(CALLBACK_MACHINE_DEBUG ON)
set(CANVAS_RENDERING_CONTEXT_2D_DEBUG ON)
set(COMMIT_DEBUG ON)
set(COMPOSE_DEBUG ON)
set(CONTEXT_SWITCH_DEBUG ON)

View File

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Debug.h>
#include <AK/ExtraMathConstants.h>
#include <AK/OwnPtr.h>
#include <LibGfx/Painter.h>
@ -109,19 +110,19 @@ void CanvasRenderingContext2D::draw_image(const HTMLImageElement& image_element,
void CanvasRenderingContext2D::scale(float sx, float sy)
{
dbgln("CanvasRenderingContext2D::scale({}, {})", sx, sy);
dbgln_if(CANVAS_RENDERING_CONTEXT_2D_DEBUG, "CanvasRenderingContext2D::scale({}, {})", sx, sy);
m_drawing_state.transform.scale(sx, sy);
}
void CanvasRenderingContext2D::translate(float tx, float ty)
{
dbgln("CanvasRenderingContext2D::translate({}, {})", tx, ty);
dbgln_if(CANVAS_RENDERING_CONTEXT_2D_DEBUG, "CanvasRenderingContext2D::translate({}, {})", tx, ty);
m_drawing_state.transform.translate(tx, ty);
}
void CanvasRenderingContext2D::rotate(float radians)
{
dbgln("CanvasRenderingContext2D::rotate({})", radians);
dbgln_if(CANVAS_RENDERING_CONTEXT_2D_DEBUG, "CanvasRenderingContext2D::rotate({})", radians);
m_drawing_state.transform.rotate_radians(radians);
}