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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc

Issue 2898953002: Remove SupportsWeakPtr inheritance from GLES2Decoder (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h"
6 6
7 #include "base/strings/string_split.h" 7 #include "base/strings/string_split.h"
8 #include "gpu/command_buffer/service/feature_info.h" 8 #include "gpu/command_buffer/service/feature_info.h"
9 #include "gpu/command_buffer/service/gl_utils.h" 9 #include "gpu/command_buffer/service/gl_utils.h"
10 #include "ui/gl/gl_version_info.h" 10 #include "ui/gl/gl_version_info.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group) 73 GLES2DecoderPassthroughImpl::GLES2DecoderPassthroughImpl(ContextGroup* group)
74 : commands_to_process_(0), 74 : commands_to_process_(0),
75 debug_marker_manager_(), 75 debug_marker_manager_(),
76 logger_(&debug_marker_manager_), 76 logger_(&debug_marker_manager_),
77 surface_(), 77 surface_(),
78 context_(), 78 context_(),
79 offscreen_(false), 79 offscreen_(false),
80 group_(group), 80 group_(group),
81 feature_info_(new FeatureInfo) { 81 feature_info_(new FeatureInfo),
82 weak_ptr_factory_(this) {
82 DCHECK(group); 83 DCHECK(group);
83 } 84 }
84 85
85 GLES2DecoderPassthroughImpl::~GLES2DecoderPassthroughImpl() {} 86 GLES2DecoderPassthroughImpl::~GLES2DecoderPassthroughImpl() {}
86 87
87 GLES2Decoder::Error GLES2DecoderPassthroughImpl::DoCommands( 88 GLES2Decoder::Error GLES2DecoderPassthroughImpl::DoCommands(
88 unsigned int num_commands, 89 unsigned int num_commands,
89 const volatile void* buffer, 90 const volatile void* buffer,
90 int num_entries, 91 int num_entries,
91 int* entries_processed) { 92 int* entries_processed) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 147 }
147 148
148 const char* GLES2DecoderPassthroughImpl::GetCommandName( 149 const char* GLES2DecoderPassthroughImpl::GetCommandName(
149 unsigned int command_id) const { 150 unsigned int command_id) const {
150 if (command_id >= kFirstGLES2Command && command_id < kNumCommands) { 151 if (command_id >= kFirstGLES2Command && command_id < kNumCommands) {
151 return gles2::GetCommandName(static_cast<CommandId>(command_id)); 152 return gles2::GetCommandName(static_cast<CommandId>(command_id));
152 } 153 }
153 return GetCommonCommandName(static_cast<cmd::CommandId>(command_id)); 154 return GetCommonCommandName(static_cast<cmd::CommandId>(command_id));
154 } 155 }
155 156
157 base::WeakPtr<GLES2Decoder> GLES2DecoderPassthroughImpl::AsWeakPtr() {
158 return weak_ptr_factory_.GetWeakPtr();
159 }
160
156 bool GLES2DecoderPassthroughImpl::Initialize( 161 bool GLES2DecoderPassthroughImpl::Initialize(
157 const scoped_refptr<gl::GLSurface>& surface, 162 const scoped_refptr<gl::GLSurface>& surface,
158 const scoped_refptr<gl::GLContext>& context, 163 const scoped_refptr<gl::GLContext>& context,
159 bool offscreen, 164 bool offscreen,
160 const DisallowedFeatures& disallowed_features, 165 const DisallowedFeatures& disallowed_features,
161 const ContextCreationAttribHelper& attrib_helper) { 166 const ContextCreationAttribHelper& attrib_helper) {
162 // Take ownership of the context and surface. The surface can be replaced 167 // Take ownership of the context and surface. The surface can be replaced
163 // with SetSurface. 168 // with SetSurface.
164 context_ = context; 169 context_ = context;
165 surface_ = surface; 170 surface_ = surface;
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 }, /* NOLINT */ 918 }, /* NOLINT */
914 919
915 const GLES2DecoderPassthroughImpl::CommandInfo 920 const GLES2DecoderPassthroughImpl::CommandInfo
916 GLES2DecoderPassthroughImpl::command_info[] = { 921 GLES2DecoderPassthroughImpl::command_info[] = {
917 GLES2_COMMAND_LIST(GLES2_CMD_OP)}; 922 GLES2_COMMAND_LIST(GLES2_CMD_OP)};
918 923
919 #undef GLES2_CMD_OP 924 #undef GLES2_CMD_OP
920 925
921 } // namespace gles2 926 } // namespace gles2
922 } // namespace gpu 927 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698