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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.h

Issue 10656019: Use cached composition bounds for firstRectForCharacterRange (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address comments Created 8 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 | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.h
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
index 700d5767746ce1802f1563e7b45598d9ac69ad3e..699f6d8fb615ad202e96599ff6bc147133400f21 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -333,6 +333,29 @@ class RenderWidgetHostViewMac : public RenderWidgetHostViewBase {
// no effect if there are no pending requests.
void AckPendingSwapBuffers();
+ // Returns true and stores first rectangle for character range if the
+ // requested |range| is already cached, otherwise returns false.
+ bool GetCachedFirstRectForCharacterRange(NSRange range, NSRect* rect,
+ NSRange* actual_range);
+
+ // Returns true if there is line break in |range| and stores line breaking
+ // point to |line_breaking_point|. The |line_break_point| is valid only if
+ // this function returns true.
+ bool GetLineBreakIndex(const std::vector<gfx::Rect>& bounds,
+ const ui::Range& range,
+ size_t* line_break_point);
+
+ // Returns composition character boundary rectangle. The |range| is
+ // composition based range. Also stores |actual_range| which is corresponding
+ // to actually used range for returned rectangle.
+ gfx::Rect GetFirstRectForCompositionRange(const ui::Range& range,
+ ui::Range* actual_range);
+
+ // Converts from given whole character range to composition oriented range. If
+ // the conversion failed, return ui::Range::InvalidRange.
+ ui::Range ConvertCharacterRangeToCompositionRange(
+ const ui::Range& request_range);
+
// These member variables should be private, but the associated ObjC class
// needs access to them and can't be made a friend.
@@ -429,6 +452,13 @@ class RenderWidgetHostViewMac : public RenderWidgetHostViewBase {
// pairs of (route_id, gpu_host_id).
std::list<std::pair<int32, int32> > pending_swap_buffers_acks_;
+ // The current composition character range and its bounds.
+ ui::Range composition_range_;
+ std::vector<gfx::Rect> composition_bounds_;
+
+ // The current caret bounds.
+ gfx::Rect caret_rect_;
+
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
};
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698