| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "sky/engine/config.h" |
| 6 #include "sky/engine/core/painting/PaintingContext.h" |
| 7 |
| 8 #include "sky/engine/platform/geometry/IntRect.h" |
| 9 #include "third_party/skia/include/core/SkCanvas.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 PaintingContext::PaintingContext(const FloatRect& bounds) |
| 14 { |
| 15 m_displayList = adoptRef(new DisplayList(bounds)); |
| 16 m_canvas = m_displayList->beginRecording(enclosingIntRect(bounds).size()); |
| 17 } |
| 18 |
| 19 PaintingContext::~PaintingContext() |
| 20 { |
| 21 } |
| 22 |
| 23 void PaintingContext::drawCircle(double x, double y, double radius, Paint* paint
) |
| 24 { |
| 25 if (!m_canvas) |
| 26 return; |
| 27 ASSERT(paint); |
| 28 ASSERT(m_displayList->isRecording()); |
| 29 m_canvas->drawCircle(x, y, radius, paint->paint()); |
| 30 } |
| 31 |
| 32 void PaintingContext::commit() |
| 33 { |
| 34 m_displayList->endRecording(); |
| 35 m_canvas = nullptr; |
| 36 } |
| 37 |
| 38 } // namespace blink |
| OLD | NEW |