Skip to content

Instantly share code, notes, and snippets.

View chinmaygarde's full-sized avatar

Chinmay Garde chinmaygarde

View GitHub Profile
@chinmaygarde
chinmaygarde / gist:7b02ce99e6243f8c378468515e4f2482
Created February 26, 2024 20:06
Flutter Supported Codecs
JPEG
PNG
GIF
Animated GIF
WebP
Animated WebP
BMP
WBMP
@chinmaygarde
chinmaygarde / gist:ae5aa5eb591d1b6fa91b2d3c718dc190
Last active February 26, 2024 20:02
Supported Source Image Formats
com.adobe.photoshop-image
com.adobe.raw-image
com.apple.atx
com.apple.icns
com.apple.pict
com.canon.cr2-raw-image
com.canon.cr3-raw-image
com.canon.crw-raw-image
com.canon.tif-raw-image
com.compuserve.gif
@chinmaygarde
chinmaygarde / FlutterEmbedderGLFW.cc
Last active November 23, 2023 16:26
Flutter Embedder API Example (GLFW with OpenGL)
#include <assert.h>
#include <chrono>
#include <embedder.h>
#include <glfw3.h>
#include <iostream>
static_assert(FLUTTER_ENGINE_VERSION == 1, "");
static const size_t kInitialWindowWidth = 800;
@chinmaygarde
chinmaygarde / customization.sh
Last active July 5, 2023 19:53
BulletTrain Customization
BULLETTRAIN_IS_SSH_CLIENT="true"
BULLETTRAIN_CUSTOM_BG="green"
BULLETTRAIN_CUSTOM_MSG="Cloudtop\ Linux"
BULLETTRAIN_CONTEXT_DEFAULT_USER=$USER
BULLETTRAIN_STATUS_EXIT_SHOW=true
BULLETTRAIN_TIME_12HR=true
BULLETTRAIN_EXEC_TIME_ELAPSED=2
BULLETTRAIN_EXEC_TIME_FG=white
BULLETTRAIN_EXEC_TIME_BG=blue
BULLETTRAIN_DIR_EXTENDED=1
@chinmaygarde
chinmaygarde / Dockerfile
Created July 2, 2018 18:09
Flutter Android on Docker
# Flutter (https://flutter.io) Developement Environment for Linux
# ===============================================================
#
# This environment passes all Linux Flutter Doctor checks and is sufficient
# for building Android applications and running Flutter tests.
#
# To build iOS applications, a Mac development environment is necessary.
#
FROM debian:stretch
@chinmaygarde
chinmaygarde / launcher_demo.dart
Created June 22, 2016 17:54
Example usage of connecting to the URI launcher and launching a URI.
import 'package:flutter/services.dart'; // for shell
import 'package:sky_services/flutter/platform/uri_launcher.mojom.dart' as mojo;
static mojo.UriLauncherProxy _initLauncherService() =>
shell.connectToApplicationService(
mojo.UriLauncher.serviceName,
mojo.UriLauncher.connectToService);
static mojo.UriLauncherProxy _launcherService = _initLauncherService();
@chinmaygarde
chinmaygarde / ScreenCapture.m
Created January 27, 2013 09:12
Mac OSX Screen Capture
CGImageRef imageRef = CGWindowListCreateImage(CGRectInfinite, kCGWindowListOptionAll, kCGNullWindowID, kCGWindowImageDefault);
CFMutableDataRef dataRef = CFDataCreateMutable(kCFAllocatorDefault, 0);
CGImageDestinationRef dest = CGImageDestinationCreateWithData(dataRef, kUTTypePNG, 1, NULL);
CGImageDestinationAddImage(dest, imageRef, NULL);
CGImageDestinationFinalize(dest);
CFRelease(dest);
CGImageRelease(imageRef);
@chinmaygarde
chinmaygarde / FlutterEngine.sublime-project
Last active December 17, 2021 00:16
FlutterEngine.sublime-project
{
"build_systems": [
{
"name": "GN Build All",
"shell_cmd": "ninja -j999",
"working_dir": "${project_path}/out/host_debug_unopt",
"file_regex": "(.*):([\\d]+):([\\d]+)?:? ?((?:error|warning|note): ?.*)",
"shell": true,
}
],
1. The texture target needs to be GLES20.GL_TEXTURE_EXTERNAL_OES instead of GL_TEXTURE_2D, e.g. in the glBindTexture calls and glTexParameteri calls.
2. In the fragment shader define a requirement to use the extension:
#extension GL_OES_EGL_image_external : require
3. For the texture sampler used in the fragment shader, use samplerExternalOES instead of sampler2D.
Everything below here is all in the C code, no more Java.
4. In the C code, use glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, eglImage) to specify where the data is, instead of using glTexImage2D family of functions.
diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm
index bc8f4c457..ee1df602c 100644
--- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm
+++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm
@@ -489,6 +489,11 @@ static void sendFakeTouchEvent(FlutterEngine* engine,
// NotifyCreated/NotifyDestroyed are synchronous and require hops between the UI and raster
// thread.
if (appeared) {
+ if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
+ NSLog(@"Attempted to call surface appeared while still in the background. Ignoring.");