Commit 61e56906 authored by Nathan Zabriskie's avatar Nathan Zabriskie Committed by Chromium LUCI CQ

Unify copy paths in RasterDecoder::CopySubTexture for OOPR Canvas2D

Currently RasterDecoder::CopySubTexture has three internal functions
for performing the copy based on the current backend. Previously
copying with Skia could require one extra copy when OneCopyRasterBuffer
was in use but this has been fixed with crrev.com/c/2517149. This CL
changes the copy to always default to Skia when OOPR Canvas is enabled.
A future CL will remove that restriction and always perform the copy
using Skia.

Bug: 984045
Change-Id: If317ceb59cf7eb93cfce521d2453a44348f6a2ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2570079Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Nathan Zabriskie <nazabris@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#844213}
parent 7878d06f
......@@ -131,10 +131,6 @@ const base::Feature kCanvas2DImageChromium {
#endif
};
// Enables the use of out of process rasterization for canvas.
const base::Feature kCanvasOopRasterization{"CanvasOopRasterization",
base::FEATURE_DISABLED_BY_DEFAULT};
// Clear the frame name for the top-level cross-browsing-context-group
// navigation.
const base::Feature kClearCrossBrowsingContextGroupMainFrameName{
......
......@@ -35,7 +35,6 @@ CONTENT_EXPORT extern const base::Feature kBrowserVerifiedUserActivationMouse;
CONTENT_EXPORT extern const base::Feature kCacheInlineScriptCode;
CONTENT_EXPORT extern const base::Feature kCacheStorageParallelOps;
CONTENT_EXPORT extern const base::Feature kCanvas2DImageChromium;
CONTENT_EXPORT extern const base::Feature kCanvasOopRasterization;
CONTENT_EXPORT extern const base::Feature
kClearCrossBrowsingContextGroupMainFrameName;
CONTENT_EXPORT extern const base::Feature kClickPointerEvent;
......
......@@ -96,6 +96,7 @@
#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/command_buffer/client/raster_interface.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/config/gpu_finch_features.h"
#include "gpu/config/gpu_switches.h"
#include "gpu/ipc/client/command_buffer_proxy_impl.h"
#include "gpu/ipc/client/gpu_channel_host.h"
......
......@@ -56,6 +56,7 @@
#include "content/renderer/worker/worker_thread_registry.h"
#include "device/gamepad/public/cpp/gamepads.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "gpu/config/gpu_finch_features.h"
#include "gpu/config/gpu_info.h"
#include "gpu/ipc/client/gpu_channel_host.h"
#include "media/audio/audio_output_device.h"
......
......@@ -58,6 +58,7 @@
#include "gpu/command_buffer/service/shared_image_representation.h"
#include "gpu/command_buffer/service/skia_utils.h"
#include "gpu/command_buffer/service/wrapped_sk_image.h"
#include "gpu/config/gpu_finch_features.h"
#include "gpu/vulkan/buildflags.h"
#include "skia/ext/legacy_display_globals.h"
#include "third_party/skia/include/core/SkCanvas.h"
......@@ -1948,7 +1949,8 @@ void RasterDecoderImpl::DoCopySubTextureINTERNAL(
return;
}
if (!shared_context_state_->GrContextIsGL()) {
if (!shared_context_state_->GrContextIsGL() ||
base::FeatureList::IsEnabled(features::kCanvasOopRasterization)) {
// Use Skia to copy texture if raster's gr_context() is not using GL.
DoCopySubTextureINTERNALSkia(xoffset, yoffset, x, y, width, height,
unpack_flip_y, source_mailbox, dest_mailbox);
......@@ -2290,6 +2292,8 @@ void RasterDecoderImpl::DoCopySubTextureINTERNALSkia(
std::vector<GrBackendSemaphore> begin_semaphores;
std::vector<GrBackendSemaphore> end_semaphores;
shared_context_state_->set_need_context_state_reset(true);
// Allow uncleared access, as we manually handle clear tracking.
std::unique_ptr<SharedImageRepresentationSkia::ScopedWriteAccess>
dest_scoped_access = dest_shared_image->BeginScopedWriteAccess(
......
......@@ -94,6 +94,10 @@ const base::Feature kDefaultEnableGpuRasterization{
const base::Feature kDefaultEnableOopRasterization{
"DefaultEnableOopRasterization", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables the use of out of process rasterization for canvas.
const base::Feature kCanvasOopRasterization{"CanvasOopRasterization",
base::FEATURE_DISABLED_BY_DEFAULT};
#if defined(OS_WIN)
// Use a high priority for GPU process on Windows.
const base::Feature kGpuProcessHighPriorityWin{
......
......@@ -29,6 +29,8 @@ GPU_EXPORT extern const base::Feature kDefaultEnableGpuRasterization;
GPU_EXPORT extern const base::Feature kDefaultEnableOopRasterization;
GPU_EXPORT extern const base::Feature kCanvasOopRasterization;
#if defined(OS_WIN)
GPU_EXPORT extern const base::Feature kGpuProcessHighPriorityWin;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment