OLD | NEW |
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 const LayoutPoint& paintOffset, | 253 const LayoutPoint& paintOffset, |
254 DisplayItem::Type displayItemType) const { | 254 DisplayItem::Type displayItemType) const { |
255 if (DrawingRecorder::useCachedDrawingIfPossible(context, *this, | 255 if (DrawingRecorder::useCachedDrawingIfPossible(context, *this, |
256 displayItemType)) | 256 displayItemType)) |
257 return; | 257 return; |
258 | 258 |
259 LayoutRect drawingRect = m_localRect; | 259 LayoutRect drawingRect = m_localRect; |
260 drawingRect.moveBy(paintOffset); | 260 drawingRect.moveBy(paintOffset); |
261 | 261 |
262 IntRect paintRect = pixelSnappedIntRect(drawingRect); | 262 IntRect paintRect = pixelSnappedIntRect(drawingRect); |
263 DrawingRecorder drawingRecorder(context, *this, DisplayItem::kCaret, | 263 DrawingRecorder drawingRecorder(context, *this, displayItemType, paintRect); |
264 paintRect); | |
265 context.fillRect(paintRect, m_color); | 264 context.fillRect(paintRect, m_color); |
266 } | 265 } |
267 | 266 |
268 String CaretDisplayItemClient::debugName() const { | 267 String CaretDisplayItemClient::debugName() const { |
269 return "Caret"; | 268 return "Caret"; |
270 } | 269 } |
271 | 270 |
272 LayoutRect CaretDisplayItemClient::visualRect() const { | 271 LayoutRect CaretDisplayItemClient::visualRect() const { |
273 return m_visualRect; | 272 return m_visualRect; |
274 } | 273 } |
275 | 274 |
276 } // namespace blink | 275 } // namespace blink |
OLD | NEW |