Chromium Code Reviews| Index: chrome/browser/android/vr_shell/vr_shell_icons.h |
| diff --git a/chrome/browser/android/vr_shell/vr_shell_icons.h b/chrome/browser/android/vr_shell/vr_shell_icons.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5231e9b1e5f73f8b37bc3dd9d053fad9acbc9593 |
| --- /dev/null |
| +++ b/chrome/browser/android/vr_shell/vr_shell_icons.h |
| @@ -0,0 +1,74 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
|
bajones
2016/09/22 22:13:30
Given that these icons will probably be removed ve
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| +// |
| +// Helper for loading bitmaps created by Gimp's "export as .c file" function. |
|
bajones
2016/09/22 22:13:30
I hate to ask, but it seems like there's some lice
|
| +// |
| +// This is a temporary placeholder since a prerequisite patch which we |
| +// need for creating these images from text strings is not yet landed. |
| +// TODO(klausw): delete this file and the icon files ASAP. |
| + |
| +#ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_ICONS_H_ |
| +#define CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_ICONS_H_ |
| + |
| +typedef struct { |
| + unsigned int width; |
| + unsigned int height; |
| + unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */ |
| + const char* rle_pixel_data; |
| +} icon_rle_image_t; |
| + |
| +// Load the two individual image files. |
| +#include "chrome/browser/android/vr_shell/icon_not_secure_small.h" |
| +#include "chrome/browser/android/vr_shell/icon_not_secure_verbose.h" |
| + |
| +// Run length decoding macro. This is as generated by Gimp's export, |
| +// just reformatted for line length limits. |
| + |
| +#define ICON_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp) \ |
| + do { \ |
| + unsigned int __bpp; \ |
| + char* __ip; \ |
| + const char *__il, *__rd; \ |
| + __bpp = (bpp); \ |
| + __ip = (image_buf); \ |
| + __il = __ip + (size)*__bpp; \ |
| + __rd = (rle_data); \ |
| + if (__bpp > 3) { /* RGBA */ \ |
| + while (__ip < __il) { \ |
| + unsigned int __l = *(__rd++); \ |
| + if (__l & 128) { \ |
| + __l = __l - 128; \ |
| + do { \ |
| + memcpy(__ip, __rd, 4); \ |
| + __ip += 4; \ |
| + } while (--__l); \ |
| + __rd += 4; \ |
| + } else { \ |
| + __l *= 4; \ |
| + memcpy(__ip, __rd, __l); \ |
| + __ip += __l; \ |
| + __rd += __l; \ |
| + } \ |
| + } \ |
| + } else { /* RGB */ \ |
| + while (__ip < __il) { \ |
| + unsigned int __l = *(__rd++); \ |
| + if (__l & 128) { \ |
| + __l = __l - 128; \ |
| + do { \ |
| + memcpy(__ip, __rd, 3); \ |
| + __ip += 3; \ |
| + } while (--__l); \ |
| + __rd += 3; \ |
| + } else { \ |
| + __l *= 3; \ |
| + memcpy(__ip, __rd, __l); \ |
| + __ip += __l; \ |
| + __rd += __l; \ |
| + } \ |
| + } \ |
| + } \ |
| + } while (0) |
| + |
| +#endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_SHELL_ICONS_H_ |