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 "include/core/SkYUVASizeInfo.h" 9 #include "include/private/SkTemplates.h" 10 computePlanes(void * base,void * planes[SkYUVASizeInfo::kMaxCount]) const11void 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