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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2849463005: Refactor ImageBuffer to make OffscreenCanvas match HTMLCanvasElement (Closed)
Patch Set: x Created 3 years, 8 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 | « third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl ('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/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index 12a534b2f80de5677ba463f55bcf4bf6abdb3fcc..807e419db49d8cba2ce44bd1c0841890c1ccf0f1 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -1500,15 +1500,17 @@ bool WebGLRenderingContextBase::PaintRenderingResultsToCanvas(
canvas()->ClearCopiedImage();
marked_canvas_dirty_ = false;
- if (!canvas()->Buffer())
+ if (!canvas()->GetOrCreateImageBuffer())
return false;
ScopedTexture2DRestorer restorer(this);
ScopedFramebufferRestorer fbo_restorer(this);
GetDrawingBuffer()->ResolveAndBindForReadAndDraw();
- if (!canvas()->Buffer()->CopyRenderingResultsFromDrawingBuffer(
- GetDrawingBuffer(), source_buffer)) {
+ if (!canvas()
+ ->GetOrCreateImageBuffer()
+ ->CopyRenderingResultsFromDrawingBuffer(GetDrawingBuffer(),
+ source_buffer)) {
// Currently, copyRenderingResultsFromDrawingBuffer is expected to always
// succeed because cases where canvas()-buffer() is not accelerated are
// handle before reaching this point. If that assumption ever stops holding
@@ -4965,7 +4967,7 @@ void WebGLRenderingContextBase::TexImageCanvasByGPU(
GLint yoffset,
const IntRect& source_sub_rectangle) {
if (!canvas->Is3d()) {
- ImageBuffer* buffer = canvas->Buffer();
+ ImageBuffer* buffer = canvas->GetOrCreateImageBuffer();
if (buffer &&
!buffer->CopyToPlatformTexture(
FunctionIDToSnapshotReason(function_id), ContextGL(), target,
« no previous file with comments | « third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698