• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2018 Google Inc.
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 "SkYUVASizeInfo.h"
9 #include "SkTemplates.h"
10 
computePlanes(void * base,void * planes[SkYUVASizeInfo::kMaxCount]) const11 void SkYUVASizeInfo::computePlanes(void* base, void* planes[SkYUVASizeInfo::kMaxCount]) const {
12     planes[0] = base;
13     int i = 1;
14     for (; i < SkYUVASizeInfo::kMaxCount; ++i) {
15         if (fSizes[i].isEmpty()) {
16             break;
17         }
18         planes[i] = SkTAddOffset<void>(planes[i - 1], fWidthBytes[i - 1] * fSizes[i - 1].height());
19     }
20     for (; i < SkYUVASizeInfo::kMaxCount; ++i) {
21         planes[i] = nullptr;
22     }
23 }
24