Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 385463002: Support FontRenderParams on Win; fix RenderTextHarfBuzz. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revise SkiaTextRenderer::SetFontRenderParams; sync and cleanup. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/render_text.cc ('k') | ui/gfx/render_text_pango.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_harfbuzz.cc
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index a174aeadbc0966d7af9ca91ef7515ee48f294023..a56552580389998a9c559cafd41af252ac9ecf32 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -16,12 +16,9 @@
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkTypeface.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/font_render_params.h"
#include "ui/gfx/utf16_indexing.h"
-#if defined(OS_WIN)
-#include "ui/gfx/font_smoothing_win.h"
-#endif
-
namespace gfx {
namespace {
@@ -777,27 +774,20 @@ void RenderTextHarfBuzz::EnsureLayout() {
void RenderTextHarfBuzz::DrawVisualText(Canvas* canvas) {
DCHECK(!needs_layout_);
-
- int current_x = 0;
-
internal::SkiaTextRenderer renderer(canvas);
ApplyFadeEffects(&renderer);
ApplyTextShadows(&renderer);
-#if defined(OS_WIN)
- bool smoothing_enabled;
- bool cleartype_enabled;
- GetCachedFontSmoothingSettings(&smoothing_enabled, &cleartype_enabled);
- // Note that |cleartype_enabled| corresponds to Skia's |enable_lcd_text|.
- renderer.SetFontSmoothingSettings(
- smoothing_enabled, cleartype_enabled && !background_is_transparent(),
- smoothing_enabled /* subpixel_positioning */);
+#if defined(OS_WIN) || defined(OS_LINUX)
Daniel Erat 2014/07/09 23:38:53 does RenderTextHarfbuzz get used for other platfor
msw 2014/07/09 23:53:00 Yeah, RenderTextHarfbuzz works on Mac too.
+ // TODO(derat): Use font-specific params: http://crbug.com/125235
+ renderer.SetFontRenderParams(GetDefaultFontRenderParams(),
+ background_is_transparent());
#endif
ApplyCompositionAndSelectionStyles();
+ int current_x = 0;
const Vector2d line_offset = GetLineOffset(0);
-
for (size_t i = 0; i < runs_.size(); ++i) {
const internal::TextRunHarfBuzz& run = *runs_[visual_to_logical_[i]];
renderer.SetTypeface(run.skia_face.get());
« no previous file with comments | « ui/gfx/render_text.cc ('k') | ui/gfx/render_text_pango.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698