| 1 |
/* |
| 2 |
* Copyright 2025 Google LLC |
| 3 |
* |
| 4 |
* Use of this source code is governed by a BSD-style license that can be |
| 5 |
* found in the LICENSE file. |
| 6 |
*/ |
| 7 |
#include "include/core/SkCPUContext.h" |
| 8 |
|
| 9 |
#include "include/core/SkTypes.h" |
| 10 |
#include "src/core/SkCPUContextImpl.h" |
| 11 |
#include "src/core/SkCPURecorderImpl.h" |
| 12 |
|
| 13 |
namespace skcpu { |
| 14 |
|
| 15 |
std::unique_ptr<const Context> Context::Make(const Context::Options& opts) { |
| 16 |
return std::make_unique<ContextImpl>(); |
| 17 |
} |
| 18 |
|
| 19 |
std::unique_ptr<const Context> Context::Make() { |
| 20 |
return Context::Make({}); |
| 21 |
} |
| 22 |
|
| 23 |
std::unique_ptr<Recorder> Context::makeRecorder() const { |
| 24 |
return std::make_unique<RecorderImpl>(static_cast<const ContextImpl*>(this)); |
| 25 |
} |
| 26 |
|
| 27 |
const ContextImpl* ContextImpl::TODO() { |
| 28 |
static const ContextImpl* gContext = static_cast<const ContextImpl*>(Context::Make().release()); |
| 29 |
return gContext; |
| 30 |
} |
| 31 |
|
| 32 |
} // namespace skcpu |