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

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

Issue 2494333002: Replace wrapUnique(new T(args)) by makeUnique<T>(args) in Blink (Closed)
Patch Set: Drop redundant WTF:: Created 4 years, 1 month 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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 AccelerationHint hint, 722 AccelerationHint hint,
723 SnapshotReason reason) const { 723 SnapshotReason reason) const {
724 if (!drawingBuffer()) 724 if (!drawingBuffer())
725 return nullptr; 725 return nullptr;
726 726
727 drawingBuffer()->resolveAndBindForReadAndDraw(); 727 drawingBuffer()->resolveAndBindForReadAndDraw();
728 IntSize size = clampedCanvasSize(); 728 IntSize size = clampedCanvasSize();
729 OpacityMode opacityMode = 729 OpacityMode opacityMode =
730 creationAttributes().hasAlpha() ? NonOpaque : Opaque; 730 creationAttributes().hasAlpha() ? NonOpaque : Opaque;
731 std::unique_ptr<AcceleratedImageBufferSurface> surface = 731 std::unique_ptr<AcceleratedImageBufferSurface> surface =
732 wrapUnique(new AcceleratedImageBufferSurface(size, opacityMode)); 732 makeUnique<AcceleratedImageBufferSurface>(size, opacityMode);
733 if (!surface->isValid()) 733 if (!surface->isValid())
734 return nullptr; 734 return nullptr;
735 std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(std::move(surface)); 735 std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(std::move(surface));
736 if (!buffer->copyRenderingResultsFromDrawingBuffer(drawingBuffer(), 736 if (!buffer->copyRenderingResultsFromDrawingBuffer(drawingBuffer(),
737 BackBuffer)) { 737 BackBuffer)) {
738 // copyRenderingResultsFromDrawingBuffer is expected to always succeed 738 // copyRenderingResultsFromDrawingBuffer is expected to always succeed
739 // because we've explicitly created an Accelerated surface and have already 739 // because we've explicitly created an Accelerated surface and have already
740 // validated it. 740 // validated it.
741 NOTREACHED(); 741 NOTREACHED();
742 return nullptr; 742 return nullptr;
(...skipping 6925 matching lines...) Expand 10 before | Expand all | Expand 10 after
7668 7668
7669 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( 7669 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas(
7670 HTMLCanvasElementOrOffscreenCanvas& result) const { 7670 HTMLCanvasElementOrOffscreenCanvas& result) const {
7671 if (canvas()) 7671 if (canvas())
7672 result.setHTMLCanvasElement(canvas()); 7672 result.setHTMLCanvasElement(canvas());
7673 else 7673 else
7674 result.setOffscreenCanvas(getOffscreenCanvas()); 7674 result.setOffscreenCanvas(getOffscreenCanvas());
7675 } 7675 }
7676 7676
7677 } // namespace blink 7677 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698