Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 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 | |
Mike Klein | 4b432fa | 2019-06-06 11:44:05 -0500 | [diff] [blame] | 8 | #include "src/gpu/GrDataUtils.h" |
Robert Phillips | c34d993 | 2019-06-18 11:57:12 +0000 | [diff] [blame] | 9 | |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 10 | #include "src/core/SkUtils.h" |
Greg Daniel | f91aeb2 | 2019-06-18 09:58:02 -0400 | [diff] [blame] | 11 | #include "src/gpu/GrColor.h" |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 12 | |
Robert Phillips | 8043f32 | 2019-05-31 08:11:36 -0400 | [diff] [blame] | 13 | struct ETC1Block { |
| 14 | uint32_t fHigh; |
| 15 | uint32_t fLow; |
| 16 | }; |
| 17 | |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 18 | static const int kNumModifierTables = 8; |
| 19 | static const int kNumPixelIndices = 4; |
| 20 | |
| 21 | // The index of each row in this table is the ETC1 table codeword |
| 22 | // The index of each column in this table is the ETC1 pixel index value |
| 23 | static const int kModifierTables[kNumModifierTables][kNumPixelIndices] = { |
| 24 | /* 0 */ { 2, 8, -2, -8 }, |
| 25 | /* 1 */ { 5, 17, -5, -17 }, |
| 26 | /* 2 */ { 9, 29, -9, -29 }, |
| 27 | /* 3 */ { 13, 42, -13, -42 }, |
| 28 | /* 4 */ { 18, 60, -18, -60 }, |
| 29 | /* 5 */ { 24, 80, -24, -80 }, |
| 30 | /* 6 */ { 33, 106, -33, -106 }, |
| 31 | /* 7 */ { 47, 183, -47, -183 } |
| 32 | }; |
| 33 | |
| 34 | static inline int convert_5To8(int b) { |
| 35 | int c = b & 0x1f; |
| 36 | return (c << 3) | (c >> 2); |
| 37 | } |
| 38 | |
| 39 | // Evaluate one of the entries in 'kModifierTables' to see how close it can get (r8,g8,b8) to |
| 40 | // the original color (rOrig, gOrib, bOrig). |
| 41 | static int test_table_entry(int rOrig, int gOrig, int bOrig, |
| 42 | int r8, int g8, int b8, |
| 43 | int table, int offset) { |
| 44 | SkASSERT(0 <= table && table < 8); |
| 45 | SkASSERT(0 <= offset && offset < 4); |
| 46 | |
| 47 | r8 = SkTPin<uint8_t>(r8 + kModifierTables[table][offset], 0, 255); |
| 48 | g8 = SkTPin<uint8_t>(g8 + kModifierTables[table][offset], 0, 255); |
| 49 | b8 = SkTPin<uint8_t>(b8 + kModifierTables[table][offset], 0, 255); |
| 50 | |
| 51 | return SkTAbs(rOrig - r8) + SkTAbs(gOrig - g8) + SkTAbs(bOrig - b8); |
| 52 | } |
| 53 | |
| 54 | // Create an ETC1 compressed block that is filled with 'col' |
| 55 | static void create_etc1_block(SkColor col, ETC1Block* block) { |
| 56 | block->fHigh = 0; |
| 57 | block->fLow = 0; |
| 58 | |
| 59 | int rOrig = SkColorGetR(col); |
| 60 | int gOrig = SkColorGetG(col); |
| 61 | int bOrig = SkColorGetB(col); |
| 62 | |
| 63 | int r5 = SkMulDiv255Round(31, rOrig); |
| 64 | int g5 = SkMulDiv255Round(31, gOrig); |
| 65 | int b5 = SkMulDiv255Round(31, bOrig); |
| 66 | |
| 67 | int r8 = convert_5To8(r5); |
| 68 | int g8 = convert_5To8(g5); |
| 69 | int b8 = convert_5To8(b5); |
| 70 | |
| 71 | // We always encode solid color textures as 555 + zero diffs |
| 72 | block->fHigh |= (r5 << 27) | (g5 << 19) | (b5 << 11) | 0x2; |
| 73 | |
| 74 | int bestTableIndex = 0, bestPixelIndex = 0; |
| 75 | int bestSoFar = 1024; |
| 76 | for (int tableIndex = 0; tableIndex < kNumModifierTables; ++tableIndex) { |
| 77 | for (int pixelIndex = 0; pixelIndex < kNumPixelIndices; ++pixelIndex) { |
| 78 | int score = test_table_entry(rOrig, gOrig, bOrig, r8, g8, b8, |
| 79 | tableIndex, pixelIndex); |
| 80 | |
| 81 | if (bestSoFar > score) { |
| 82 | bestSoFar = score; |
| 83 | bestTableIndex = tableIndex; |
| 84 | bestPixelIndex = pixelIndex; |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | block->fHigh |= (bestTableIndex << 5) | (bestTableIndex << 2); |
| 90 | |
| 91 | for (int i = 0; i < 16; ++i) { |
| 92 | block->fLow |= bestPixelIndex << 2*i; |
| 93 | } |
| 94 | } |
| 95 | |
Robert Phillips | 8043f32 | 2019-05-31 08:11:36 -0400 | [diff] [blame] | 96 | static int num_ETC1_blocks(int w, int h) { |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 97 | if (w < 4) { |
| 98 | w = 1; |
| 99 | } else { |
| 100 | SkASSERT((w & 3) == 0); |
| 101 | w >>= 2; |
| 102 | } |
| 103 | |
| 104 | if (h < 4) { |
| 105 | h = 1; |
| 106 | } else { |
| 107 | SkASSERT((h & 3) == 0); |
| 108 | h >>= 2; |
| 109 | } |
| 110 | |
| 111 | return w * h; |
| 112 | } |
| 113 | |
Robert Phillips | 8043f32 | 2019-05-31 08:11:36 -0400 | [diff] [blame] | 114 | size_t GrETC1CompressedDataSize(int width, int height) { |
| 115 | int numBlocks = num_ETC1_blocks(width, height); |
| 116 | |
| 117 | return numBlocks * sizeof(ETC1Block); |
| 118 | } |
| 119 | |
Robert Phillips | 28a5a43 | 2019-06-07 12:46:21 -0400 | [diff] [blame] | 120 | // Fill in 'dest' with ETC1 blocks derived from 'colorf' |
| 121 | static void fillin_ETC1_with_color(int width, int height, const SkColor4f& colorf, void* dest) { |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 122 | SkColor color = colorf.toSkColor(); |
| 123 | |
| 124 | ETC1Block block; |
| 125 | create_etc1_block(color, &block); |
| 126 | |
Robert Phillips | 8043f32 | 2019-05-31 08:11:36 -0400 | [diff] [blame] | 127 | int numBlocks = num_ETC1_blocks(width, height); |
| 128 | |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 129 | for (int i = 0; i < numBlocks; ++i) { |
Robert Phillips | e3bd673 | 2019-05-29 14:20:35 -0400 | [diff] [blame] | 130 | ((ETC1Block*)dest)[i] = block; |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 131 | } |
| 132 | } |
| 133 | |
Robert Phillips | 28a5a43 | 2019-06-07 12:46:21 -0400 | [diff] [blame] | 134 | // Fill in the width x height 'dest' with the munged version of 'colorf' that matches 'config' |
| 135 | static bool fill_buffer_with_color(GrPixelConfig config, int width, int height, |
| 136 | const SkColor4f& colorf, void* dest) { |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 137 | SkASSERT(kRGB_ETC1_GrPixelConfig != config); |
| 138 | |
| 139 | GrColor color = colorf.toBytes_RGBA(); |
| 140 | |
| 141 | uint8_t r = GrColorUnpackR(color); |
| 142 | uint8_t g = GrColorUnpackG(color); |
| 143 | uint8_t b = GrColorUnpackB(color); |
| 144 | uint8_t a = GrColorUnpackA(color); |
| 145 | |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 146 | switch (config) { |
| 147 | case kAlpha_8_GrPixelConfig: // fall through |
| 148 | case kAlpha_8_as_Alpha_GrPixelConfig: // fall through |
| 149 | case kAlpha_8_as_Red_GrPixelConfig: { |
| 150 | memset(dest, a, width * height); |
| 151 | break; |
| 152 | } |
| 153 | case kGray_8_GrPixelConfig: // fall through |
| 154 | case kGray_8_as_Lum_GrPixelConfig: // fall through |
| 155 | case kGray_8_as_Red_GrPixelConfig: { |
| 156 | uint8_t gray8 = SkComputeLuminance(r, g, b); |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 157 | |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 158 | memset(dest, gray8, width * height); |
| 159 | break; |
| 160 | } |
| 161 | case kRGB_565_GrPixelConfig: { |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 162 | uint16_t rgb565 = SkPack888ToRGB16(r, g, b); |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 163 | |
| 164 | sk_memset16((uint16_t*) dest, rgb565, width * height); |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 165 | break; |
| 166 | } |
| 167 | case kRGBA_4444_GrPixelConfig: { |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 168 | uint8_t r4 = (r >> 4) & 0xF; |
| 169 | uint8_t g4 = (g >> 4) & 0xF; |
| 170 | uint8_t b4 = (b >> 4) & 0xF; |
| 171 | uint8_t a4 = (a >> 4) & 0xF; |
| 172 | |
| 173 | uint16_t rgba4444 = r4 << SK_R4444_SHIFT | g4 << SK_G4444_SHIFT | |
| 174 | b4 << SK_B4444_SHIFT | a4 << SK_A4444_SHIFT; |
| 175 | |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 176 | sk_memset16((uint16_t*) dest, rgba4444, width * height); |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 177 | break; |
| 178 | } |
| 179 | case kRGBA_8888_GrPixelConfig: { |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 180 | sk_memset32((uint32_t *) dest, color, width * height); |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 181 | break; |
| 182 | } |
| 183 | case kRGB_888_GrPixelConfig: { |
| 184 | uint8_t* dest8 = (uint8_t*) dest; |
| 185 | for (int i = 0; i < width * height; ++i, dest8 += 3) { |
| 186 | dest8[0] = r; |
| 187 | dest8[1] = g; |
| 188 | dest8[2] = b; |
| 189 | } |
| 190 | break; |
| 191 | } |
| 192 | case kRGB_888X_GrPixelConfig: { |
| 193 | GrColor opaque = GrColorPackRGBA(r, g, b, 0xFF); |
| 194 | |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 195 | sk_memset32((uint32_t *) dest, opaque, width * height); |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 196 | break; |
| 197 | } |
| 198 | case kRG_88_GrPixelConfig: { |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 199 | uint16_t rg88 = (r << 8) | g; |
| 200 | |
| 201 | sk_memset16((uint16_t*) dest, rg88, width * height); |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 202 | break; |
| 203 | } |
| 204 | case kBGRA_8888_GrPixelConfig: { |
| 205 | GrColor swizzled = GrColorPackRGBA(b, g, r, a); |
| 206 | |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 207 | sk_memset32((uint32_t *) dest, swizzled, width * height); |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 208 | break; |
| 209 | } |
| 210 | case kSRGBA_8888_GrPixelConfig: { |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 211 | sk_memset32((uint32_t *) dest, color, width * height); |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 212 | break; |
| 213 | } |
| 214 | case kSBGRA_8888_GrPixelConfig: { |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 215 | GrColor swizzled = GrColorPackRGBA(b, g, r, a); |
| 216 | |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 217 | sk_memset32((uint32_t *) dest, swizzled, width * height); |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 218 | break; |
| 219 | } |
| 220 | case kRGBA_1010102_GrPixelConfig: { |
| 221 | uint32_t r10 = SkScalarRoundToInt(colorf.fR * 1023.0f); |
| 222 | uint32_t g10 = SkScalarRoundToInt(colorf.fG * 1023.0f); |
| 223 | uint32_t b10 = SkScalarRoundToInt(colorf.fB * 1023.0f); |
| 224 | uint8_t a2 = SkScalarRoundToInt(colorf.fA * 3.0f); |
| 225 | |
| 226 | uint32_t rgba1010102 = a2 << 30 | b10 << 20 | g10 << 10 | r10; |
| 227 | |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 228 | sk_memset32((uint32_t *) dest, rgba1010102, width * height); |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 229 | break; |
| 230 | } |
| 231 | case kRGBA_float_GrPixelConfig: { |
| 232 | SkColor4f* destColor = (SkColor4f*) dest; |
| 233 | for (int i = 0; i < width * height; ++i) { |
| 234 | destColor[i] = colorf; |
| 235 | } |
| 236 | break; |
| 237 | } |
| 238 | case kRG_float_GrPixelConfig: { |
| 239 | float* destFloat = (float*) dest; |
| 240 | for (int i = 0; i < width * height; ++i, destFloat += 2) { |
| 241 | destFloat[0] = colorf.fR; |
| 242 | destFloat[1] = colorf.fG; |
| 243 | } |
| 244 | break; |
| 245 | } |
| 246 | case kAlpha_half_as_Red_GrPixelConfig: // fall through |
| 247 | case kAlpha_half_GrPixelConfig: { |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 248 | SkHalf alphaHalf = SkFloatToHalf(colorf.fA); |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 249 | |
| 250 | sk_memset16((uint16_t *) dest, alphaHalf, width * height); |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 251 | break; |
| 252 | } |
| 253 | case kRGBA_half_GrPixelConfig: // fall through |
| 254 | case kRGBA_half_Clamped_GrPixelConfig: { |
Robert Phillips | b5e331a | 2019-05-28 10:58:09 -0400 | [diff] [blame] | 255 | uint64_t rHalf = SkFloatToHalf(colorf.fR); |
| 256 | uint64_t gHalf = SkFloatToHalf(colorf.fG); |
| 257 | uint64_t bHalf = SkFloatToHalf(colorf.fB); |
| 258 | uint64_t aHalf = SkFloatToHalf(colorf.fA); |
| 259 | |
| 260 | uint64_t rgbaHalf = (aHalf << 48) | (bHalf << 32) | (gHalf << 16) | rHalf; |
| 261 | |
| 262 | sk_memset64((uint64_t *) dest, rgbaHalf, width * height); |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 263 | break; |
| 264 | } |
Robert Phillips | fe18de5 | 2019-06-06 17:21:50 -0400 | [diff] [blame] | 265 | case kR_16_GrPixelConfig: { |
| 266 | uint16_t r16 = SkScalarRoundToInt(colorf.fR * 65535.0f); |
| 267 | sk_memset16((uint16_t*) dest, r16, width * height); |
| 268 | break; |
| 269 | } |
| 270 | case kRG_1616_GrPixelConfig: { |
| 271 | uint16_t r16 = SkScalarRoundToInt(colorf.fR * 65535.0f); |
| 272 | uint16_t g16 = SkScalarRoundToInt(colorf.fG * 65535.0f); |
| 273 | |
| 274 | uint32_t rg1616 = r16 << 16 | g16; |
| 275 | |
| 276 | sk_memset32((uint32_t*) dest, rg1616, width * height); |
| 277 | break; |
| 278 | } |
Robert Phillips | 66a4603 | 2019-06-18 08:00:42 -0400 | [diff] [blame^] | 279 | // Experimental (for Y416 and mutant P016/P010) |
| 280 | case kRGBA_16161616_GrPixelConfig: { |
| 281 | uint64_t r16 = SkScalarRoundToInt(colorf.fR * 65535.0f); |
| 282 | uint64_t g16 = SkScalarRoundToInt(colorf.fG * 65535.0f); |
| 283 | uint64_t b16 = SkScalarRoundToInt(colorf.fB * 65535.0f); |
| 284 | uint64_t a16 = SkScalarRoundToInt(colorf.fA * 65535.0f); |
| 285 | |
| 286 | uint64_t rgba16161616 = (a16 << 48) | (b16 << 32) | (g16 << 16) | r16; |
| 287 | sk_memset64((uint64_t*) dest, rgba16161616, width * height); |
| 288 | break; |
| 289 | } |
| 290 | case kRG_half_GrPixelConfig: { |
| 291 | uint32_t rHalf = SkFloatToHalf(colorf.fR); |
| 292 | uint32_t gHalf = SkFloatToHalf(colorf.fG); |
| 293 | |
| 294 | uint32_t rgHalf = (rHalf << 16) | gHalf; |
| 295 | |
| 296 | sk_memset32((uint32_t *) dest, rgHalf, width * height); |
| 297 | break; |
| 298 | } |
Robert Phillips | 459b295 | 2019-05-23 09:38:27 -0400 | [diff] [blame] | 299 | default: |
| 300 | return false; |
| 301 | break; |
| 302 | } |
| 303 | |
| 304 | return true; |
| 305 | } |
Robert Phillips | 28a5a43 | 2019-06-07 12:46:21 -0400 | [diff] [blame] | 306 | |
| 307 | size_t GrComputeTightCombinedBufferSize(GrCompression compression, size_t bytesPerPixel, |
| 308 | int baseWidth, int baseHeight, |
| 309 | SkTArray<size_t>* individualMipOffsets, |
| 310 | int mipLevelCount) { |
| 311 | SkASSERT(individualMipOffsets && !individualMipOffsets->count()); |
| 312 | SkASSERT(mipLevelCount >= 1); |
| 313 | |
| 314 | individualMipOffsets->push_back(0); |
| 315 | |
| 316 | size_t combinedBufferSize = baseWidth * bytesPerPixel * baseHeight; |
| 317 | if (GrCompression::kETC1 == compression) { |
| 318 | SkASSERT(0 == bytesPerPixel); |
| 319 | bytesPerPixel = 4; // munge Bpp to make the following code work (and not assert) |
| 320 | combinedBufferSize = GrETC1CompressedDataSize(baseWidth, baseHeight); |
| 321 | } |
| 322 | |
| 323 | int currentWidth = baseWidth; |
| 324 | int currentHeight = baseHeight; |
| 325 | |
| 326 | // The Vulkan spec for copying a buffer to an image requires that the alignment must be at |
| 327 | // least 4 bytes and a multiple of the bytes per pixel of the image config. |
| 328 | SkASSERT(bytesPerPixel == 1 || bytesPerPixel == 2 || bytesPerPixel == 3 || |
| 329 | bytesPerPixel == 4 || bytesPerPixel == 8 || bytesPerPixel == 16); |
| 330 | int desiredAlignment = (bytesPerPixel == 3) ? 12 : (bytesPerPixel > 4 ? bytesPerPixel : 4); |
| 331 | |
| 332 | for (int currentMipLevel = 1; currentMipLevel < mipLevelCount; ++currentMipLevel) { |
| 333 | currentWidth = SkTMax(1, currentWidth / 2); |
| 334 | currentHeight = SkTMax(1, currentHeight / 2); |
| 335 | |
| 336 | size_t trimmedSize; |
| 337 | if (GrCompression::kETC1 == compression) { |
| 338 | trimmedSize = GrETC1CompressedDataSize(currentWidth, currentHeight); |
| 339 | } else { |
| 340 | trimmedSize = currentWidth * bytesPerPixel * currentHeight; |
| 341 | } |
| 342 | const size_t alignmentDiff = combinedBufferSize % desiredAlignment; |
| 343 | if (alignmentDiff != 0) { |
| 344 | combinedBufferSize += desiredAlignment - alignmentDiff; |
| 345 | } |
| 346 | SkASSERT((0 == combinedBufferSize % 4) && (0 == combinedBufferSize % bytesPerPixel)); |
| 347 | |
| 348 | individualMipOffsets->push_back(combinedBufferSize); |
| 349 | combinedBufferSize += trimmedSize; |
| 350 | } |
| 351 | |
| 352 | SkASSERT(individualMipOffsets->count() == mipLevelCount); |
| 353 | return combinedBufferSize; |
| 354 | } |
| 355 | |
| 356 | void GrFillInData(GrCompression compression, GrPixelConfig config, |
| 357 | int baseWidth, int baseHeight, |
| 358 | const SkTArray<size_t>& individualMipOffsets, char* dstPixels, |
| 359 | const SkColor4f& colorf) { |
| 360 | |
| 361 | int mipLevels = individualMipOffsets.count(); |
| 362 | |
| 363 | int currentWidth = baseWidth; |
| 364 | int currentHeight = baseHeight; |
| 365 | for (int currentMipLevel = 0; currentMipLevel < mipLevels; ++currentMipLevel) { |
| 366 | size_t offset = individualMipOffsets[currentMipLevel]; |
| 367 | |
| 368 | if (GrCompression::kETC1 == compression) { |
| 369 | // TODO: compute the ETC1 block for 'colorf' just once |
| 370 | fillin_ETC1_with_color(currentWidth, currentHeight, colorf, &(dstPixels[offset])); |
| 371 | } else { |
| 372 | fill_buffer_with_color(config, currentWidth, currentHeight, colorf, |
| 373 | &(dstPixels[offset])); |
| 374 | } |
| 375 | |
| 376 | currentWidth = SkTMax(1, currentWidth / 2); |
| 377 | currentHeight = SkTMax(1, currentHeight / 2); |
| 378 | } |
| 379 | } |
| 380 | |