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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2391883004: Implement WebGL's commit with software compositing (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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 "Commit() was called on a context whose " 697 "Commit() was called on a context whose "
698 "OffscreenCanvas is not associated with a " 698 "OffscreenCanvas is not associated with a "
699 "canvas element."); 699 "canvas element.");
700 return; 700 return;
701 } 701 }
702 if (!drawingBuffer()) 702 if (!drawingBuffer())
703 return; 703 return;
704 // TODO(crbug.com/646864): Make commit() work correctly with 704 // TODO(crbug.com/646864): Make commit() work correctly with
705 // { preserveDrawingBuffer : true }. 705 // { preserveDrawingBuffer : true }.
706 getOffscreenCanvas()->getOrCreateFrameDispatcher()->dispatchFrame( 706 getOffscreenCanvas()->getOrCreateFrameDispatcher()->dispatchFrame(
707 std::move(drawingBuffer()->transferToStaticBitmapImage())); 707 std::move(drawingBuffer()->transferToStaticBitmapImage()),
708 drawingBuffer()->contextProvider()->isSoftwareRendering());
708 } 709 }
709 710
710 PassRefPtr<Image> WebGLRenderingContextBase::getImage( 711 PassRefPtr<Image> WebGLRenderingContextBase::getImage(
711 AccelerationHint hint, 712 AccelerationHint hint,
712 SnapshotReason reason) const { 713 SnapshotReason reason) const {
713 if (!drawingBuffer()) 714 if (!drawingBuffer())
714 return nullptr; 715 return nullptr;
715 716
716 drawingBuffer()->commit(); 717 drawingBuffer()->commit();
717 IntSize size = clampedCanvasSize(); 718 IntSize size = clampedCanvasSize();
(...skipping 6723 matching lines...) Expand 10 before | Expand all | Expand 10 after
7441 7442
7442 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7443 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7443 HTMLCanvasElementOrOffscreenCanvas& result) const { 7444 HTMLCanvasElementOrOffscreenCanvas& result) const {
7444 if (canvas()) 7445 if (canvas())
7445 result.setHTMLCanvasElement(canvas()); 7446 result.setHTMLCanvasElement(canvas());
7446 else 7447 else
7447 result.setOffscreenCanvas(getOffscreenCanvas()); 7448 result.setOffscreenCanvas(getOffscreenCanvas());
7448 } 7449 }
7449 7450
7450 } // namespace blink 7451 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698