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

Unified Diff: Source/core/rendering/compositing/CompositedSelectionBound.h

Issue 454643002: Route selection bounds updates through WebLayerTreeView (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revised Created 6 years, 3 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
Index: Source/core/rendering/compositing/CompositedSelectionBound.h
diff --git a/Source/web/tests/FloatPointTestHelpers.h b/Source/core/rendering/compositing/CompositedSelectionBound.h
similarity index 68%
copy from Source/web/tests/FloatPointTestHelpers.h
copy to Source/core/rendering/compositing/CompositedSelectionBound.h
index 2ef2ee07fe3bb2d7ae60416992c8039769a93d72..d9cc88a412fa983f32f4f8a587f8d281ceafb718 100644
--- a/Source/web/tests/FloatPointTestHelpers.h
+++ b/Source/core/rendering/compositing/CompositedSelectionBound.h
@@ -27,24 +27,38 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FloatPointTestHelpers_h
-#define FloatPointTestHelpers_h
-#include "platform/geometry/FloatPoint.h"
+#ifndef CompositedSelectionBound_h
+#define CompositedSelectionBound_h
-#include <gtest/gtest.h>
+#include "platform/geometry/FloatPoint.h"
+#include "platform/graphics/GraphicsLayer.h"
-// Gtest will automatically pick up this function if included to print out
-// FloatPoints, rather than just spitting out their memory.
namespace blink {
-inline void PrintTo(const FloatPoint& point, ::std::ostream* os)
-{
- *os << "FloatPoint("
- << std::fixed
- << std::setprecision(4) << point.x() << "f, "
- << std::setprecision(4) << point.y() << "f)";
- os->unsetf(std::ios::floatfield);
-}
-}
-
-#endif // FloatPointTestHelpers_h
+
+struct CompositedSelectionBound {
+ enum Type {
+ Caret,
+ SelectionLeft,
+ SelectionRight
+ };
+
+ CompositedSelectionBound()
+ : type(Caret)
+ , layer(nullptr)
+ {
+ }
+
+ Type type;
+
+ // The structure describes the position of a caret in space of the GraphicsLayer the caret resides in.
+ // Where edgeTopInLayer is the top point of the caret, usually on the ascend line of the line box,
+ // and edgeBottomInLayer it the bottom point, on the baseline of the line box.
+ GraphicsLayer* layer;
+ FloatPoint edgeTopInLayer;
+ FloatPoint edgeBottomInLayer;
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698