xref: /aosp_15_r20/external/skia/tools/text/gpu/TextBlobTools.cpp (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1 /*
2  * Copyright 2024 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 
8 #include "tools/text/gpu/TextBlobTools.h"
9 
10 #include "src/text/gpu/SubRunContainer.h"
11 #include "src/text/gpu/TextBlob.h"
12 
13 namespace sktext::gpu {
14 
FirstSubRun(const TextBlob * blob)15 const AtlasSubRun* TextBlobTools::FirstSubRun(const TextBlob* blob) {
16     SkASSERT(blob);
17     if (blob->fSubRuns->fSubRuns.isEmpty()) {
18         return nullptr;
19     }
20     return blob->fSubRuns->fSubRuns.front().testingOnly_atlasSubRun();
21 }
22 
23 }  // namespace sktext::gpu
24