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

Unified Diff: ui/gfx/render_text.h

Issue 8725002: Draw text via Skia in RenderTextLinux. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years 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 | « no previous file | ui/gfx/render_text.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.h
===================================================================
--- ui/gfx/render_text.h (revision 113610)
+++ ui/gfx/render_text.h (working copy)
@@ -13,14 +13,47 @@
#include "base/i18n/rtl.h"
#include "base/string16.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "third_party/skia/include/core/SkPaint.h"
#include "ui/base/range/range.h"
#include "ui/gfx/font.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/selection_model.h"
+class SkCanvas;
+struct SkPoint;
+
namespace gfx {
+class Canvas;
+class RenderTextTest;
+
+namespace internal {
+
+// Internal helper class used by derived classes to draw text through Skia.
+class SkiaTextRenderer {
+ public:
+ explicit SkiaTextRenderer(Canvas* canvas);
+ ~SkiaTextRenderer();
+
+ void SetFont(const gfx::Font& font);
+ void SetForegroundColor(SkColor foreground);
+ void DrawSelection(const std::vector<Rect>& selection, SkColor color);
+ void DrawPosText(const SkPoint* pos,
+ const uint16* glyphs,
+ size_t glyph_count);
+ void DrawDecorations(int x, int y, int width, bool underline, bool strike);
+ void DrawCursor(const gfx::Rect& bounds);
+
+ private:
+ SkCanvas* canvas_skia_;
+ SkPaint paint_;
+
+ DISALLOW_COPY_AND_ASSIGN(SkiaTextRenderer);
+};
+
+} // namespace internal
+
// Color settings for text, backgrounds and cursor.
// These are tentative, and should be derived from theme, system
// settings and current settings.
@@ -31,9 +64,6 @@
const SkColor kUnfocusedSelectionColor = SK_ColorLTGRAY;
const SkColor kCursorColor = SK_ColorBLACK;
-class Canvas;
-class RenderTextTest;
-
// A visual style applicable to a range of text.
struct UI_EXPORT StyleRange {
StyleRange();
@@ -248,6 +278,9 @@
Point ToTextPoint(const Point& point);
Point ToViewPoint(const Point& point);
+ // Returns the origin point for drawing text via Skia.
+ Point GetOriginForSkiaDrawing();
+
private:
friend class RenderTextTest;
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698