Skip to content

Instantly share code, notes, and snippets.

View HalCanary's full-sized avatar

Hal Canary HalCanary

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<style>
body { font-size: 1000%; }
</style>
</head>
<body> &#x1F600; </body>
#include "gm.h"
#include "SkGradientShader.h"
DEF_SIMPLE_GM(HAL_xfermodes, canvas, 576, 640) {
SkXfermode::Mode modes[] = {
SkXfermode::kClear_Mode,
SkXfermode::kSrc_Mode,
SkXfermode::kDst_Mode,
SkXfermode::kSrcOver_Mode,
SkXfermode::kDstOver_Mode,
SkXfermode::kSrcIn_Mode,
class SkImmutablePixmap {
public:
SkImmutablePixmap(const SkImageInfo& info,
const void* addr,
size_t rowBytes,
SkColorTable* ctable = NULL)
: fPixels(addr), fCTable(ctable), fRowBytes(rowBytes), fInfo(info) {
SkASSERT((kIndex_8_SkColorType == info.colorType())
== (ctable != nullptr));
}
/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkEffects_DEFINED
#define SkEffects_DEFINED
#include "SkColor.h"
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkValues_DEFINED
#define SkValues_DEFINED
#define SK_TAGGED_UNION_U_1(X) X* f##X;
1 0 0 -1 0 256 cm %% set CTM (flip coords)
1 1 1 RG 1 1 1 rg %% set colors
/G0 gs %% set graphic object /G0
0 0 256 256 re %% make rect
f %% fill rect
q %% save()
192 64 m %% moveto()
64 64 l %% lineto()
64 192 l %% lineto()
192 192 l %% lineto()
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
class UnicodeIterator {
public:
UnicodeIterator(const SkPaint& paint, const void* txt, size_t len)
: fBegin((const char*)txt)
#! /bin/sh
# Starting with clean Raspbian:
# https://www.raspberrypi.org/downloads/raspbian/
# Also:
# 1) Set Locale, Timezone, Keyboard
# 2) Connect to open WiFi network.
echo 'disable_overscan=1' | sudo tee -a /boot/config.txt > /dev/null
#include "sk_types.h"
void concat_matrices(sk_matrix_t* dst,
const sk_matrix_t* matrixU,
const sk_matrix_t* matrixV) {
const float* u = matrixU->mat;
const float* v = matrixV->mat;
sk_matrix_t result = {{
u[0] * v[0] + u[1] * v[3] + u[2] * v[6],
u[0] * v[1] + u[1] * v[4] + u[2] * v[7],