Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp

Issue 2417773003: Fix content upside down when call OffscreenCanvas's commit (Closed)
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/gpu/gpu_tests/pixel_test_pages.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
index 58a98254728ae45166f81769e0009da05415cf98..3a8add5ec8d03e1204650b25508bdc5d632787d9 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
@@ -183,6 +183,7 @@ void OffscreenCanvasFrameDispatcherImpl::dispatchFrame(
// TODO(crbug.com/646022): making this overlay-able.
resource.is_overlay_candidate = false;
+ bool yflipped = false;
OffscreenCanvasCommitType commitType;
DEFINE_THREAD_SAFE_STATIC_LOCAL(
EnumerationHistogram, commitTypeHistogram,
@@ -194,6 +195,7 @@ void OffscreenCanvasFrameDispatcherImpl::dispatchFrame(
// Case 1: both canvas and compositor are gpu accelerated.
commitType = CommitGPUCanvasGPUCompositing;
setTransferableResourceToStaticBitmapImage(resource, image);
+ yflipped = true;
} else {
// Case 2: canvas is accelerated but --disable-gpu-compositing is
// specified, or WebGL's commit is called with SwiftShader. The latter
@@ -208,6 +210,7 @@ void OffscreenCanvasFrameDispatcherImpl::dispatchFrame(
// Case 3: canvas is not gpu-accelerated, but compositor is
commitType = CommitSoftwareCanvasGPUCompositing;
setTransferableResourceToSharedGPUContext(resource, image);
+ yflipped = true;
} else {
// Case 4: both canvas and compositor are not gpu accelerated.
commitType = CommitSoftwareCanvasSoftwareCompositing;
@@ -230,7 +233,6 @@ void OffscreenCanvasFrameDispatcherImpl::dispatchFrame(
const gfx::PointF uvTopLeft(0.f, 0.f);
const gfx::PointF uvBottomRight(1.f, 1.f);
float vertexOpacity[4] = {1.f, 1.f, 1.f, 1.f};
- const bool yflipped = false;
// TODO(crbug.com/645994): this should be true when using style
// "image-rendering: pixelated".
const bool nearestNeighbor = false;
« no previous file with comments | « content/test/gpu/gpu_tests/pixel_test_pages.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698