Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into xhr-request-metrics
Browse files Browse the repository at this point in the history
Change-Id: I3c106aa1177bd5d50a30be8e4535850524c57e57
  • Loading branch information
at-ninja committed Mar 25, 2024
2 parents 46f2834 + 4753e86 commit 94f45b2
Show file tree
Hide file tree
Showing 49 changed files with 265 additions and 256 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
steps:
- uses: kaidokert/[email protected]
timeout-minutes: 30
- name: Set up JDK 17
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
java-version: 11
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3 #v1.0.6
- name: Build with Gradle
Expand Down
19 changes: 19 additions & 0 deletions cobalt/browser/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/statistics_recorder.h"
#include "base/metrics/user_metrics.h"
#include "base/optional.h"
Expand Down Expand Up @@ -82,6 +83,7 @@
#include "starboard/event.h"
#include "starboard/extension/crash_handler.h"
#include "starboard/extension/installation_manager.h"
#include "starboard/extension/loader_app_metrics.h"
#include "starboard/system.h"
#include "url/gurl.h"

Expand Down Expand Up @@ -617,6 +619,22 @@ void AddCrashLogApplicationState(base::ApplicationState state) {
<< "required version, so not sending application state.";
}

void RecordLoaderAppMetrics() {
auto metrics_extension =
static_cast<const StarboardExtensionLoaderAppMetricsApi*>(
SbSystemGetExtension(kStarboardExtensionLoaderAppMetricsName));
if (metrics_extension &&
strcmp(metrics_extension->name,
kStarboardExtensionLoaderAppMetricsName) == 0 &&
metrics_extension->version >= 1) {
base::UmaHistogramEnumeration(
"Cobalt.LoaderApp.CrashpadInstallationStatus",
metrics_extension->GetCrashpadInstallationStatus());
LOG(INFO) << "Recorded sample for "
<< "Cobalt.LoaderApp.CrashpadInstallationStatus";
}
}

} // namespace

// Static user logs
Expand Down Expand Up @@ -1023,6 +1041,7 @@ Application::Application(const base::Closure& quit_closure, bool should_preload,
#endif // ENABLE_DEBUG_COMMAND_LINE_SWITCHES

AddCrashLogApplicationState(base::kApplicationStateStarted);
RecordLoaderAppMetrics();
}

Application::~Application() {
Expand Down
38 changes: 0 additions & 38 deletions cobalt/renderer/rasterizer/pixel_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,6 @@
#include "third_party/glm/glm/gtc/matrix_transform.hpp"
#include "third_party/glm/glm/gtx/transform.hpp"

#define BILINEAR_FILTERING_SUPPORTED 1
#define NV12_TEXTURE_SUPPORTED 1

#if defined(STARBOARD)
#if !SB_HAS(BILINEAR_FILTERING_SUPPORT)
#undef BILINEAR_FILTERING_SUPPORTED
#define BILINEAR_FILTERING_SUPPORTED 0
#endif
#endif

#if defined(STARBOARD)
#if !SB_HAS(NV12_TEXTURE_SUPPORT)
#undef NV12_TEXTURE_SUPPORTED
#define NV12_TEXTURE_SUPPORTED 0
#endif
#endif

using cobalt::loader::image::AnimatedWebPImage;
using cobalt::loader::image::MockImageDecoder;
using cobalt::loader::image::MockImageDecoderCallback;
Expand Down Expand Up @@ -1346,9 +1329,6 @@ scoped_refptr<Image> MakeI420Image(ResourceProvider* resource_provider,
std::move(image_memory), image_data_descriptor);
}

// The software rasterizer does not support NV12 images.
#if NV12_TEXTURE_SUPPORTED

// Creates a two plane YUV image where the Y channel is stored as a
// single-channel image plane and the U and V channels are interleaved in a
// second image plane. The NV12 format dictates that the UV plane has the same
Expand Down Expand Up @@ -1412,7 +1392,6 @@ scoped_refptr<Image> MakeNV12Image(ResourceProvider* resource_provider,
return resource_provider->CreateMultiPlaneImageFromRawMemory(
std::move(image_memory), image_data_descriptor);
}
#endif // #if NV12_TEXTURE_SUPPORTED
} // namespace

scoped_refptr<Image> MakeUYVYImage(ResourceProvider* resource_provider,
Expand Down Expand Up @@ -1576,9 +1555,6 @@ TEST_F(PixelTest, YUV422UYVYImageScaledAndTranslated) {
-1.0f, 0.0f, 0.0f, 1.0f)));
}

// The software rasterizer does not support NV12 images.
#if NV12_TEXTURE_SUPPORTED

TEST_F(PixelTest, TwoPlaneYUVImageSupport) {
// Tests that an ImageNode hooked up to a 3-plane YUV image works fine.
scoped_refptr<Image> image =
Expand All @@ -1605,7 +1581,6 @@ TEST_F(PixelTest, TwoPlaneYUVImageWithTransform) {
TranslateMatrix(-half_output_size.width(),
-half_output_size.height())));
}
#endif // #if NV12_TEXTURE_SUPPORTED

TEST_F(PixelTest, ImageNodeLocalTransformRotationAndScale) {
scoped_refptr<Image> image =
Expand Down Expand Up @@ -2075,8 +2050,6 @@ TEST_F(PixelTest, ImageEdgeNoWrapWithPixelCentersOffset) {
PointF(100.0f, 100.51f), kNumCascades));
}

#if BILINEAR_FILTERING_SUPPORTED

TEST_F(PixelTest, ImagesAreLinearlyInterpolated) {
// We want to make sure that image pixels are accessed through a bilinear
// interpolation magnification filter.
Expand All @@ -2097,27 +2070,20 @@ TEST_F(PixelTest, ZoomedInImagesDoNotWrapInterpolated) {
ScaleMatrix(2) * TranslateMatrix(-0.5f, -0.5f)));
}

#endif // BILINEAR_FILTERING_SUPPORTED

TEST_F(PixelTest, YUV3PlaneImagesAreLinearlyInterpolated) {
// Tests that three plane YUV images are bilinearly interpolated.
scoped_refptr<Image> image = MakeI420Image(GetResourceProvider(), Size(8, 8));

TestTree(new ImageNode(image, RectF(output_surface_size())));
}

// The software rasterizer does not support NV12 images.
#if NV12_TEXTURE_SUPPORTED

TEST_F(PixelTest, YUV2PlaneImagesAreLinearlyInterpolated) {
// Tests that two plane YUV images are bilinearly interpolated.
scoped_refptr<Image> image = MakeNV12Image(GetResourceProvider(), Size(8, 8));

TestTree(new ImageNode(image, RectF(output_surface_size())));
}

#endif // #if NV12_TEXTURE_SUPPORTED

TEST_F(PixelTest, VeryLargeOpacityFilterDoesNotOccupyVeryMuchMemory) {
// This test ensures that an opacity filter being applied to an extremely
// large surface works just fine. This test is interesting because opacity
Expand Down Expand Up @@ -4071,17 +4037,13 @@ TEST_F(PixelTest, MapToMeshRGBTest) {
TestTree(CreateMapToMeshTestRenderTree(GetResourceProvider(), image));
}

#if NV12_TEXTURE_SUPPORTED

TEST_F(PixelTest, MapToMeshNV12Test) {
// Tests that MapToMesh filter works as expected with a NV12 YUV texture.
scoped_refptr<Image> image =
MakeNV12Image(GetResourceProvider(), Size(200, 200));
TestTree(CreateMapToMeshTestRenderTree(GetResourceProvider(), image));
}

#endif // #if NV12_TEXTURE_SUPPORTED

TEST_F(PixelTest, MapToMeshI420Test) {
// Tests that MapToMesh filter works as expected with a I420 YUV texture.
scoped_refptr<Image> image =
Expand Down
3 changes: 0 additions & 3 deletions cobalt/site/docs/development/setup-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ return and complete the following steps.

1. Download and install [Android Studio](https://developer.android.com/studio/).

1. Install [JDK 17](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
and make sure it's before any other JDK on your PATH.

1. To enable parallel gradle builds, add the following to your `~/.bashrc`:

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Book: /youtube/cobalt/_book.yaml

| Properties |
| :--- |
| **`SB_HAS_NV12_TEXTURE_SUPPORT`**<br><br>Indicates whether or not the given platform supports rendering of NV12 textures. These textures typically originate from video decoders.<br><br>The default value in the Stub implementation is `0` |
| **`SB_HAS_VIRTUAL_REALITY`**<br><br>The default value in the Stub implementation is `1` |


Expand Down
1 change: 0 additions & 1 deletion cobalt/site/docs/reference/starboard/gn-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Book: /youtube/cobalt/_book.yaml
| **`starboard_level_final_executable_type`**<br><br>The default value is `"executable"`. |
| **`starboard_level_gtest_target_type`**<br><br>The default value is `"executable"`. |
| **`static_library_configs`**<br><br> Target-specific configurations for static_library targets.<br><br>The default value is `[]`. |
| **`use_skia_next`**<br><br> Flag to use a future version of Skia, currently not available.<br><br>The default value is `false`. |
| **`use_thin_archive`**<br><br> Whether or not to link with thin archives.<br><br>The default value is `true`. |
| **`v8_enable_pointer_compression_override`**<br><br> Set to true to enable pointer compression for v8.<br><br>The default value is `true`. |
| **`v8_enable_webassembly`**<br><br> Enable WASM and install WebAssembly global.<br><br>The default value is `false`. |
7 changes: 0 additions & 7 deletions cobalt/site/docs/reference/starboard/modules/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@ header available.

Whether the current platform has 64-bit atomic operations.

### SB_HAS_GLES2

Specifies whether this platform has a performant OpenGL ES 2 implementation,
which allows client applications to use GL rendering paths. Derived from the gyp
variable `gl_type` gl_type which indicates what kind of GL implementation is
available.

### SB_HAS_QUIRK(SB_FEATURE)

Determines at compile-time whether this platform has a quirk.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,7 @@ static bool SbDecodeTargetIsValid(SbDecodeTarget handle)
Returns ownership of `decode_target` to the Starboard implementation. This
function will likely result in the destruction of the SbDecodeTarget and all its
associated surfaces, though in some cases, platforms may simply adjust a
reference count. In the case where SB_HAS(GLES2), this function must be called
on a thread with the context
reference count. This function must be called on a thread with the context

#### Declaration

Expand Down
16 changes: 3 additions & 13 deletions docker/linux/android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,14 @@ ARG FROM_IMAGE
FROM ${FROM_IMAGE:-cobalt-build-base}

# TODO: b/309157124 - add --no-install-recommends.
RUN apt update -qqy
RUN apt install -qqy \
curl \
RUN apt update -qqy \
&& apt install -qqy \
libxml2-dev \
default-jdk \
binutils-arm-linux-gnueabi \
g++-multilib \
&& /opt/clean-after-apt.sh

# Jdk17, verify SHA256 of the installation file, then install it.
ARG JDK17_DOWNLOAD_URL="https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.deb"
ARG JDK17_TMP_FILE="/tmp/jdk-17_linux-x64_bin.deb"
ARG JDK17_SHA256SUM="0871ec2276b3440ab03e4bb1e77a9d7645f82eb9d6c449d743a585845c370269 ${JDK17_TMP_FILE}"

RUN curl --location --silent --output ${JDK17_TMP_FILE} ${JDK17_DOWNLOAD_URL} \
&& echo ${JDK17_SHA256SUM} | sha256sum --check \
&& apt install -qqy ${JDK17_TMP_FILE} \
&& rm ${JDK17_TMP_FILE}

RUN mkdir -p /root/.android

RUN keytool -genkey -v \
Expand Down
5 changes: 1 addition & 4 deletions starboard/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ group("gn_all") {
"//starboard/client_porting/eztime",
"//starboard/client_porting/eztime:eztime_test",
"//starboard/client_porting/icu_init",
"//starboard/examples/glclear:starboard_glclear_example",
"//starboard/examples/hello_world:starboard_hello_world_example",
"//starboard/examples/window:starboard_window_example",
"//starboard/extension:extension_test",
Expand All @@ -33,10 +34,6 @@ group("gn_all") {
"//starboard/nplb/nplb_evergreen_compat_tests",
]

if (gl_type != "none") {
deps += [ "//starboard/examples/glclear:starboard_glclear_example" ]
}

if (has_platform_targets) {
deps += [ "//$starboard_path/platform_targets" ]
}
Expand Down
7 changes: 7 additions & 0 deletions starboard/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ since the version previous to it.

## Version 16

### Removed SB_HAS_NV12_TEXTURE_SUPPORT
This flag is resolved at run-time.

### GLES2 configuration mandatory
SB_HAS_GLES2 configuration has been removed, and `gl_type` GN config no longer
accepts `none` as an option.

### Removed pre-C++11 hash map configuration
Build configurations for `SB_HAS_STD_UNORDERED_HASH`, `SB_HAS_LONG_LONG_HASH`,
`SB_HAS_STRING_HASH`, `SB_HAS_HASH_USING`, `SB_HAS_HASH_VALUE`,
Expand Down
4 changes: 2 additions & 2 deletions starboard/android/apk/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ android {
ndkVersion NDK_VERSION

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

aaptOptions {
Expand Down
2 changes: 1 addition & 1 deletion starboard/android/apk/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx8g
org.gradle.jvmargs=-Xmx4g

# Android Studio plugin 3.0 adds the testOnly=1 attribute to the APK manifest
# which means that it can't be installed without the '-t' parameter passed to
Expand Down
6 changes: 0 additions & 6 deletions starboard/android/shared/configuration_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@
// the current linking unit.
#define SB_IMPORT_PLATFORM

// --- Graphics Configuration ------------------------------------------------

// Indicates whether or not the given platform supports rendering of NV12
// textures. These textures typically originate from video decoders.
#define SB_HAS_NV12_TEXTURE_SUPPORT 1

// --- I/O Configuration -----------------------------------------------------
// Whether the current platform has speech synthesis.
#define SB_HAS_SPEECH_SYNTHESIS 1
Expand Down
6 changes: 0 additions & 6 deletions starboard/build/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ config("starboard") {
"COBALT", # TODO: See if this can be replaced by STARBOARD macro.
]

if (gl_type == "none") {
defines += [ "SB_GN_GL_TYPE_IS_NONE=1" ]
} else {
defines += [ "SB_GN_GL_TYPE_IS_NONE=0" ]
}

if (!is_gold) {
defines += [
"ENABLE_DEBUGGER",
Expand Down
4 changes: 0 additions & 4 deletions starboard/build/config/base_configuration.gni
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ declare_args() {

# The source of EGL and GLES headers and libraries.
# Valid values (case and everything sensitive!):
# "none" - No EGL + GLES implementation is available on this platform.
# "system_gles2" - Use the system implementation of EGL + GLES2. The
# headers and libraries must be on the system include and
# link paths.
Expand Down Expand Up @@ -162,9 +161,6 @@ declare_args() {
# Enables an NPLB audit of C++17 support.
sb_enable_cpp17_audit = true

# Flag to use a future version of Skia, currently not available.
use_skia_next = false

# Enable when using clang 16.
is_clang_16 = false

Expand Down
18 changes: 0 additions & 18 deletions starboard/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,6 @@ struct CompileAssert {};
"starboard/<PLATFORM_PATH>/configuration_constants.cc."
#endif

#if !defined(SB_HAS_NV12_TEXTURE_SUPPORT)
#error "Your platform must define SB_HAS_NV12_TEXTURE_SUPPORT."
#endif

#if defined(SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT)
#error \
"SB_HAS_MEDIA_IS_VIDEO_SUPPORTED_REFINEMENT should not be defined for " \
Expand Down Expand Up @@ -574,20 +570,6 @@ struct CompileAssert {};
#define SB_FUNCTION __FUNCTION__
#endif

// --- Gyp Derived Configuration -----------------------------------------------

// Specifies whether this platform has a performant OpenGL ES 2 implementation,
// which allows client applications to use GL rendering paths. Derived from
// the gyp variable `gl_type` which indicates what kind of GL implementation
// is available.
#if !defined(SB_HAS_GLES2)
#if defined(SB_GN_GL_TYPE_IS_NONE)
#define SB_HAS_GLES2 !SB_GN_GL_TYPE_IS_NONE
#else
#define SB_HAS_GLES2 !SB_GYP_GL_TYPE_IS_NONE
#endif
#endif

// --- Deprecated Feature Macros -----------------------------------------------

// Deprecated feature macros are no longer referenced by application code, and
Expand Down
Loading

0 comments on commit 94f45b2

Please sign in to comment.