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

Side by Side Diff: sky/engine/core/editing/Caret.cpp

Issue 768493002: Get rid of CompositingState. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix incorrect case. Created 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 return adoptPtr(new DragCaretController); 54 return adoptPtr(new DragCaretController);
55 } 55 }
56 56
57 bool DragCaretController::isContentRichlyEditable() const 57 bool DragCaretController::isContentRichlyEditable() const
58 { 58 {
59 return isRichlyEditablePosition(m_position.deepEquivalent()); 59 return isRichlyEditablePosition(m_position.deepEquivalent());
60 } 60 }
61 61
62 void DragCaretController::setCaretPosition(const VisiblePosition& position) 62 void DragCaretController::setCaretPosition(const VisiblePosition& position)
63 { 63 {
64 // for querying RenderLayer::compositingState()
65 // This code is probably correct, since it doesn't occur in a stack that inv olves updating compositing state.
66 DisableCompositingQueryAsserts disabler;
67
68 if (Node* node = m_position.deepEquivalent().deprecatedNode()) 64 if (Node* node = m_position.deepEquivalent().deprecatedNode())
69 invalidateCaretRect(node); 65 invalidateCaretRect(node);
70 m_position = position; 66 m_position = position;
71 setCaretRectNeedsUpdate(); 67 setCaretRectNeedsUpdate();
72 Document* document = 0; 68 Document* document = 0;
73 if (Node* node = m_position.deepEquivalent().deprecatedNode()) { 69 if (Node* node = m_position.deepEquivalent().deprecatedNode()) {
74 invalidateCaretRect(node); 70 invalidateCaretRect(node);
75 document = &node->document(); 71 document = &node->document();
76 } 72 }
77 if (m_position.isNull() || m_position.isOrphan()) { 73 if (m_position.isNull() || m_position.isOrphan()) {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 context->fillRect(caret, caretColor); 245 context->fillRect(caret, caretColor);
250 } 246 }
251 247
252 void DragCaretController::paintDragCaret(LocalFrame* frame, GraphicsContext* p, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const 248 void DragCaretController::paintDragCaret(LocalFrame* frame, GraphicsContext* p, const LayoutPoint& paintOffset, const LayoutRect& clipRect) const
253 { 249 {
254 if (m_position.deepEquivalent().deprecatedNode()->document().frame() == fram e) 250 if (m_position.deepEquivalent().deprecatedNode()->document().frame() == fram e)
255 paintCaret(m_position.deepEquivalent().deprecatedNode(), p, paintOffset, clipRect); 251 paintCaret(m_position.deepEquivalent().deprecatedNode(), p, paintOffset, clipRect);
256 } 252 }
257 253
258 } 254 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698