flutter_flutter/engine/core/painting/PaintingContext.cpp
Ian Fischer 1799eacef5 Decouple Canvas from DisplayList and map Picture and PictureRecorder more directly to their Skia counterparts.
Also changes the framework dart code to use the
refactored APIs and fixes the various examples and
tests.

R=abarth@chromium.org, ianh@chromium.org

Review URL: https://codereview.chromium.org/1190123003.
2015-06-24 10:21:45 -07:00

38 lines
1.1 KiB
C++

// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sky/engine/core/painting/PaintingContext.h"
#include "sky/engine/core/dom/Document.h"
#include "sky/engine/core/dom/Element.h"
#include "sky/engine/core/painting/PaintingTasks.h"
#include "sky/engine/platform/geometry/IntRect.h"
namespace blink {
PassRefPtr<PaintingContext> PaintingContext::create(PassRefPtr<Element> element, const FloatSize& size)
{
return adoptRef(new PaintingContext(element, size));
}
// TODO(iansf): Get rid of PaintingContext, which is only relevant to DOM-based
// Sky apps, which are now deprecated. For now, make the compiler
// happy by constructing Canvas with a nullptr.
PaintingContext::PaintingContext(PassRefPtr<Element> element, const FloatSize& size)
: Canvas(nullptr)
, m_element(element)
{
}
PaintingContext::~PaintingContext()
{
}
void PaintingContext::commit()
{
m_element->document().scheduleVisualUpdate();
}
} // namespace blink