OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gfx/render_text_win.h" | 5 #include "ui/gfx/render_text_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 canvas_skia->drawPosText(run->glyphs.get(), byte_length, &pos[0], paint); | 723 canvas_skia->drawPosText(run->glyphs.get(), byte_length, &pos[0], paint); |
724 | 724 |
725 if (run->strike || run->underline) | 725 if (run->strike || run->underline) |
726 DrawTextRunDecorations(canvas_skia, paint, *run, run_x, y); | 726 DrawTextRunDecorations(canvas_skia, paint, *run, run_x, y); |
727 } | 727 } |
728 } | 728 } |
729 | 729 |
730 void RenderTextWin::DrawCursor(Canvas* canvas) { | 730 void RenderTextWin::DrawCursor(Canvas* canvas) { |
731 // Paint cursor. Replace cursor is drawn as rectangle for now. | 731 // Paint cursor. Replace cursor is drawn as rectangle for now. |
732 // TODO(msw): Draw a better cursor with a better indication of association. | 732 // TODO(msw): Draw a better cursor with a better indication of association. |
733 if (cursor_visible() && focused()) { | 733 if (cursor_visible() && focused()) |
734 Rect r(GetUpdatedCursorBounds()); | 734 canvas->DrawRect(GetUpdatedCursorBounds(), kCursorColor); |
735 canvas->DrawRectInt(kCursorColor, r.x(), r.y(), r.width(), r.height()); | |
736 } | |
737 } | 735 } |
738 | 736 |
739 RenderText* RenderText::CreateRenderText() { | 737 RenderText* RenderText::CreateRenderText() { |
740 return new RenderTextWin; | 738 return new RenderTextWin; |
741 } | 739 } |
742 | 740 |
743 } // namespace gfx | 741 } // namespace gfx |
OLD | NEW |