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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 2163093002: remove linked_ptr from gpu/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix? win32 compile Created 4 years, 5 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 | « gpu/command_buffer/service/common_decoder.cc ('k') | gpu/command_buffer/service/mailbox_manager_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 03ce04134dc62c31df4633c1137cbb290af7591c..ec22bd69ea1f37070179fc2c89836957a1fef534 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -19,7 +19,6 @@
#include "base/callback.h"
#include "base/callback_helpers.h"
#include "base/logging.h"
-#include "base/memory/linked_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_math.h"
#include "base/strings/string_number_conversions.h"
@@ -521,6 +520,8 @@ class BackFramebuffer {
struct FenceCallback {
FenceCallback() : fence(gl::GLFence::Create()) { DCHECK(fence); }
+ FenceCallback(FenceCallback&&) = default;
+ FenceCallback& operator=(FenceCallback&&) = default;
std::vector<base::Closure> callbacks;
std::unique_ptr<gl::GLFence> fence;
};
@@ -2245,7 +2246,7 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
bool gpu_trace_commands_;
bool gpu_debug_commands_;
- std::queue<linked_ptr<FenceCallback> > pending_readpixel_fences_;
+ std::queue<FenceCallback> pending_readpixel_fences_;
// After a second fence is inserted, both the GpuChannelMessageQueue and
// CommandExecutor are descheduled. Once the first fence has completed, both
@@ -10520,8 +10521,7 @@ error::Error GLES2DecoderImpl::HandleReadPixels(uint32_t immediate_data_size,
// PIXEL_PACK_BUFFER is bound, and all these settings haven't been
// sent to GL.
glReadPixels(x, y, width, height, format, type, 0);
- pending_readpixel_fences_.push(linked_ptr<FenceCallback>(
- new FenceCallback()));
+ pending_readpixel_fences_.push(FenceCallback());
WaitForReadPixels(base::Bind(&GLES2DecoderImpl::FinishReadPixels,
base::AsWeakPtr(this), c, buffer));
glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, 0);
@@ -14371,7 +14371,7 @@ void GLES2DecoderImpl::ProcessPendingQueries(bool did_finish) {
// this function will call the callback immediately.
void GLES2DecoderImpl::WaitForReadPixels(base::Closure callback) {
if (features().use_async_readpixels && !pending_readpixel_fences_.empty()) {
- pending_readpixel_fences_.back()->callbacks.push_back(callback);
+ pending_readpixel_fences_.back().callbacks.push_back(callback);
} else {
callback.Run();
}
@@ -14383,9 +14383,9 @@ void GLES2DecoderImpl::ProcessPendingReadPixels(bool did_finish) {
// that's not guaranteed by all GLFence implementations.
while (!pending_readpixel_fences_.empty() &&
(did_finish ||
- pending_readpixel_fences_.front()->fence->HasCompleted())) {
+ pending_readpixel_fences_.front().fence->HasCompleted())) {
std::vector<base::Closure> callbacks =
- pending_readpixel_fences_.front()->callbacks;
+ std::move(pending_readpixel_fences_.front().callbacks);
pending_readpixel_fences_.pop();
for (size_t i = 0; i < callbacks.size(); i++) {
callbacks[i].Run();
« no previous file with comments | « gpu/command_buffer/service/common_decoder.cc ('k') | gpu/command_buffer/service/mailbox_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698