New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: color emoji! #1

Closed
wants to merge 74 commits into
base: master
from
Commits
Jump to file or symbol
Failed to load files and symbols.
+32 −2
Diff settings

Always

Just for now

Viewing a subset of changes. View all

bulk drawing

  • Loading branch information...
koron committed Nov 22, 2017
commit 58c4cab4c6fdd57e4e4a174d6f88c23ff96fb304
Copy path View file
@@ -395,6 +395,7 @@ class GdiTextRenderer FINAL : public IDWriteTextRenderer
struct DWriteContext {
int mVersion;
bool mDrawing;
FLOAT mDpiScaleX;
FLOAT mDpiScaleY;
@@ -433,6 +434,8 @@ struct DWriteContext {
void DrawText1(const WCHAR* text, int len,
int x, int y, int w, int h, COLORREF color);
void Flush(void);
float PixelsToDipsX(int x);
float PixelsToDipsY(int y);
@@ -446,6 +449,7 @@ struct DWriteContext {
DWriteContext::DWriteContext() :
mVersion(1),
mDrawing(false),
mDpiScaleX(1.f),
mDpiScaleY(1.f),
mD2D1Factory(NULL),
@@ -731,7 +735,11 @@ DWriteContext::DrawText(HDC hdc, const WCHAR* text, int len,
DWriteContext::DrawText1(const WCHAR* text, int len,
int x, int y, int w, int h, COLORREF color)
{
mRT->BeginDraw();
if (mDrawing == false)
{
mRT->BeginDraw();
mDrawing = true;
}
mBrush->SetColor(D2D1::ColorF(UINT32(GetRValue(color)) << 16 |
UINT32(GetGValue(color)) << 8 | UINT32(GetBValue(color))));
mRT->DrawText(text, len, mTextFormat,
@@ -742,7 +750,16 @@ DWriteContext::DrawText1(const WCHAR* text, int len,
PixelsToDipsY(y + h)),
mBrush,
(D2D1_DRAW_TEXT_OPTIONS)D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT);
mRT->EndDraw();
}
void
DWriteContext::Flush(void)
{
if (mDrawing)
{
mRT->EndDraw();
mDrawing = false;
}
}
float
@@ -905,6 +922,13 @@ DWriteContext_DrawText(
}

This comment has been minimized.

@koron

koron Nov 22, 2017

Owner

DWriteContextのメソッドに移しちゃったほうが良いかも。

This comment has been minimized.

@koron

koron Nov 23, 2017

Owner

done in local.

}
void
DWriteContext_Flush(DWriteContext *ctx)
{
if (ctx != NULL)
ctx->Flush();
}
void
DWriteContext_Close(DWriteContext *ctx)
{
Copy path View file
@@ -68,6 +68,7 @@ void DWriteContext_DrawText(
int h,
int cellWidth,
COLORREF color);
void DWriteContext_Flush(DWriteContext *ctx);
void DWriteContext_Close(DWriteContext *ctx);
void DWriteContext_SetRenderingParams(
Copy path View file
@@ -6498,6 +6498,11 @@ gui_mch_flush(void)
BOOL __stdcall GdiFlush(void);
# endif
#if defined(FEAT_DIRECTX)
if (IS_ENABLE_DIRECTX())
DWriteContext_Flush(s_dwc);
#endif
GdiFlush();
}
ProTip! Use n and p to navigate between commits in a pull request.