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

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 494823002: Plumb selection edge points through the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « content/common/cc_messages.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/renderer/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 *result = int_value; 78 *result = int_value;
79 return true; 79 return true;
80 } else { 80 } else {
81 LOG(WARNING) << "Failed to parse switch " << switch_string << ": " << 81 LOG(WARNING) << "Failed to parse switch " << switch_string << ": " <<
82 string_value; 82 string_value;
83 return false; 83 return false;
84 } 84 }
85 } 85 }
86 86
87 cc::LayerSelectionBound ConvertWebSelectionBound( 87 cc::LayerSelectionBound ConvertWebSelectionBound(
88 const WebSelectionBound& bound) { 88 const WebSelectionBound& web_bound) {
89 DCHECK(bound.layerId); 89 DCHECK(web_bound.layerId);
90 90
91 cc::LayerSelectionBound result; 91 cc::LayerSelectionBound cc_bound;
92 switch (bound.type) { 92 switch (web_bound.type) {
93 case blink::WebSelectionBound::Caret: 93 case blink::WebSelectionBound::Caret:
94 result.type = cc::SELECTION_BOUND_CENTER; 94 cc_bound.type = cc::SELECTION_BOUND_CENTER;
95 break; 95 break;
96 case blink::WebSelectionBound::SelectionLeft: 96 case blink::WebSelectionBound::SelectionLeft:
97 result.type = cc::SELECTION_BOUND_LEFT; 97 cc_bound.type = cc::SELECTION_BOUND_LEFT;
98 break; 98 break;
99 case blink::WebSelectionBound::SelectionRight: 99 case blink::WebSelectionBound::SelectionRight:
100 result.type = cc::SELECTION_BOUND_RIGHT; 100 cc_bound.type = cc::SELECTION_BOUND_RIGHT;
101 break; 101 break;
102 } 102 }
103 result.layer_id = bound.layerId; 103 cc_bound.layer_id = web_bound.layerId;
104 result.layer_rect = gfx::Rect(bound.edgeRectInLayer); 104 cc_bound.edge_top = gfx::Point(web_bound.edgeTopInLayer);
105 return result; 105 cc_bound.edge_bottom = gfx::Point(web_bound.edgeBottomInLayer);
106 return cc_bound;
106 } 107 }
107 108
108 gfx::Size CalculateDefaultTileSize() { 109 gfx::Size CalculateDefaultTileSize() {
109 int default_tile_size = 256; 110 int default_tile_size = 256;
110 #if defined(OS_ANDROID) 111 #if defined(OS_ANDROID)
111 // TODO(epenner): unify this for all platforms if it 112 // TODO(epenner): unify this for all platforms if it
112 // makes sense (http://crbug.com/159524) 113 // makes sense (http://crbug.com/159524)
113 114
114 gfx::DeviceDisplayInfo info; 115 gfx::DeviceDisplayInfo info;
115 bool real_size_supported = true; 116 bool real_size_supported = true;
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 widget_->OnSwapBuffersAborted(); 818 widget_->OnSwapBuffersAborted();
818 } 819 }
819 820
820 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { 821 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() {
821 cc::ContextProvider* provider = 822 cc::ContextProvider* provider =
822 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 823 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
823 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 824 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
824 } 825 }
825 826
826 } // namespace content 827 } // namespace content
OLDNEW
« no previous file with comments | « content/common/cc_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698