History

convert explicit shared pointer creation (using "new") to make_shared where possible/appropriate

Heather Anderson committed 5 years ago

Commit bcce9a21 parent 88b004562 files · +107 −107Browse files

Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 62 files). Show all

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+3−3
@@ -2024,7 +2024,7 @@ void GeometryCache::useGridPipeline(gpu::Batch& batch, GridBuffer gridBuffer, bo · 2023 unmodified lines
20242024 };
20252025
20262026 for (auto& key : keys) {
2027− gpu::StatePointer state = gpu::StatePointer(new gpu::State());
2027+ gpu::StatePointer state = std::make_shared<gpu::State>();
20282028 state->setDepthTest(true, !std::get<0>(key), gpu::LESS_EQUAL);
20292029 if (std::get<0>(key)) {
20302030 PrepareStencil::testMask(*state);
@@ -2132,7 +2132,7 @@ gpu::PipelinePointer GeometryCache::getWebBrowserProgram(bool transparent, bool · 101 unmodified lines
21322132 // For any non-opaque or non-deferred pipeline, we use web_browser_forward
21332133 auto pipeline = (transparent || forward) ? web_browser_forward : web_browser;
21342134
2135− gpu::StatePointer state = gpu::StatePointer(new gpu::State());
2135+ gpu::StatePointer state = std::make_shared<gpu::State>();
21362136 state->setDepthTest(true, !transparent, gpu::LESS_EQUAL);
21372137 // FIXME: do we need a testMaskDrawNoAA?
21382138 PrepareStencil::testMaskDrawShapeNoAA(*state);
@@ -2419,7 +2419,7 @@ graphics::MeshPointer GeometryCache::meshFromShape(Shape geometryShape, glm::vec · 280 unmodified lines
24192419 colorsBufferView.edit<glm::vec3>((gpu::BufferView::Index)i) = color;
24202420 }
24212421
2422− graphics::MeshPointer mesh(new graphics::Mesh());
2422+ graphics::MeshPointer mesh(std::make_shared<graphics::Mesh>());
24232423 mesh->setVertexBuffer(positionsBufferView);
24242424 mesh->setIndexBuffer(indexBufferView);
24252425 mesh->addAttribute(gpu::Stream::NORMAL, normalsBufferView);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t