Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Cairo] Remove the cairo_glyph_t complexity from GlyphBuffer
https://bugs.webkit.org/show_bug.cgi?id=177598 Reviewed by Carlos Garcia Campos. Source/WebCore: Remove the decade-old use of cairo_glyph_t as the underlying type for Glyph. The former spans 24 bytes in size, while the latte is just 2 bytes. The x and y coordinate attributes of cairo_glyph_t were only used in FontCascade::drawGlyphs() implementation, where they were overridden even if the same GlyphBuffer object was used here repeatedly. FontCascade::drawGlyphs() now creates a new Vector<cairo_glyph_t> object and fills it only with the glyph index and coordinates data for glyphs that will actually be drawn. This will likely in the future be leveraged to pack the necessary data and perform the drawing operations in parallelized tasks. GlyphBuffer usages that before required USE(CAIRO) special-casing can now be simplified. This also removes the need for <cairo.h> header inclusion in the GlyphBuffer.h header. This further removes Cairo header inclusion in roughly 600 build targets. No new tests -- no change in behavior. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::widthForSimpleText const): * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::glyphAt const): (WebCore::GlyphBuffer::add): * platform/graphics/cairo/FontCairo.cpp: (WebCore::drawGlyphsToContext): (WebCore::drawGlyphsShadow): (WebCore::FontCascade::drawGlyphs): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): Source/WebKit: * Shared/API/c/cairo/WKImageCairo.cpp: Explicitly include the <cairo.h> header here now that it's not included in GlyphBuffer.h. * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: Ditto. Canonical link: https://commits.webkit.org/193895@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
70 additions
and 52 deletions.
- +38 −0 Source/WebCore/ChangeLog
- +0 −10 Source/WebCore/platform/graphics/FontCascade.cpp
- +1 −25 Source/WebCore/platform/graphics/GlyphBuffer.h
- +18 −13 Source/WebCore/platform/graphics/cairo/FontCairo.cpp
- +0 −4 Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp
- +11 −0 Source/WebKit/ChangeLog
- +1 −0 Source/WebKit/Shared/API/c/cairo/WKImageCairo.cpp
- +1 −0 Source/WebKit/WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -32,6 +32,7 @@ | ||
#include "WebImage.h" | ||
#include <WebCore/GraphicsContext.h> | ||
#include <WebCore/PlatformContextCairo.h> | ||
#include <cairo.h> | ||
|
||
using namespace WebKit; | ||
using namespace WebCore; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -38,6 +38,7 @@ | ||
#include <WebCore/GraphicsContext.h> | ||
#include <WebCore/Pasteboard.h> | ||
#include <WebCore/PlatformContextCairo.h> | ||
#include <cairo.h> | ||
|
||
using namespace WebCore; | ||
|
||