| 1 |
/* |
| 2 |
* Copyright 2026 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 "src/gpu/ganesh/image/GrMippedBitmap.h" |
| 8 |
|
| 9 |
std::optional<GrMippedBitmap> GrMippedBitmap::Make( |
| 10 |
SkImageInfo ii, const void* pixels, size_t rowBytes, ReleaseProc proc, void* context) { |
| 11 |
SkBitmap bm; |
| 12 |
if (!bm.installPixels(ii, const_cast<void*>(pixels), rowBytes, proc, context)) { |
| 13 |
return {}; |
| 14 |
} |
| 15 |
bm.setImmutable(); |
| 16 |
return GrMippedBitmap(bm, /*mipmaps=*/nullptr); |
| 17 |
|
| 18 |
} // namespace skgpu::ganesh |