Bumping manifests a=b2g-bump
[gecko.git] / gfx / 2d / DrawTarget.cpp
blob63f7289938235c6576ea11b7ae743a744314ccdd
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "2D.h"
7 #include "Logging.h"
9 #include "DrawTargetCapture.h"
11 namespace mozilla {
12 namespace gfx {
14 TemporaryRef<DrawTargetCapture>
15 DrawTarget::CreateCaptureDT(const IntSize& aSize)
17 RefPtr<DrawTargetCaptureImpl> dt = new DrawTargetCaptureImpl();
19 if (!dt->Init(aSize, this)) {
20 gfxWarning() << "Failed to initialize Capture DrawTarget!";
21 return nullptr;
24 return dt;
27 void
28 DrawTarget::DrawCapturedDT(DrawTargetCapture *aCaptureDT,
29 const Matrix& aTransform)
31 if (aTransform.HasNonIntegerTranslation()) {
32 gfxWarning() << "Non integer translations are not supported for DrawCaptureDT at this time!";
33 return;
35 static_cast<DrawTargetCaptureImpl*>(aCaptureDT)->ReplayToDrawTarget(this, aTransform);