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

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

Issue 937263006: Refactored GLContext to own GPUTiming which spawn GPUTimingClients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added GPUTiming descriptions for all 3 classes, refptr in GPUTimer Created 5 years, 10 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gl_context_virtual.h" 5 #include "gpu/command_buffer/service/gl_context_virtual.h"
6 6
7 #include "gpu/command_buffer/service/gl_state_restorer_impl.h" 7 #include "gpu/command_buffer/service/gl_state_restorer_impl.h"
8 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 8 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
9 #include "ui/gl/gl_surface.h" 9 #include "ui/gl/gl_surface.h"
10 #include "ui/gl/gpu_timing.h"
10 11
11 namespace gpu { 12 namespace gpu {
12 13
13 GLContextVirtual::GLContextVirtual( 14 GLContextVirtual::GLContextVirtual(
14 gfx::GLShareGroup* share_group, 15 gfx::GLShareGroup* share_group,
15 gfx::GLContext* shared_context, 16 gfx::GLContext* shared_context,
16 base::WeakPtr<gles2::GLES2Decoder> decoder) 17 base::WeakPtr<gles2::GLES2Decoder> decoder)
17 : GLContext(share_group), 18 : GLContext(share_group),
18 shared_context_(shared_context), 19 shared_context_(shared_context),
19 display_(NULL), 20 display_(NULL),
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return shared_context_->IsCurrent(surface); 76 return shared_context_->IsCurrent(surface);
76 77
77 // Otherwise, only insure the context itself is current. 78 // Otherwise, only insure the context itself is current.
78 return shared_context_->IsCurrent(NULL); 79 return shared_context_->IsCurrent(NULL);
79 } 80 }
80 81
81 void* GLContextVirtual::GetHandle() { 82 void* GLContextVirtual::GetHandle() {
82 return shared_context_->GetHandle(); 83 return shared_context_->GetHandle();
83 } 84 }
84 85
86 scoped_refptr<gfx::GPUTimingClient> GLContextVirtual::CreateGPUTimingClient() {
87 return shared_context_->CreateGPUTimingClient();
88 }
89
85 void GLContextVirtual::OnSetSwapInterval(int interval) { 90 void GLContextVirtual::OnSetSwapInterval(int interval) {
86 shared_context_->SetSwapInterval(interval); 91 shared_context_->SetSwapInterval(interval);
87 } 92 }
88 93
89 std::string GLContextVirtual::GetExtensions() { 94 std::string GLContextVirtual::GetExtensions() {
90 return shared_context_->GetExtensions(); 95 return shared_context_->GetExtensions();
91 } 96 }
92 97
93 bool GLContextVirtual::GetTotalGpuMemory(size_t* bytes) { 98 bool GLContextVirtual::GetTotalGpuMemory(size_t* bytes) {
94 return shared_context_->GetTotalGpuMemory(bytes); 99 return shared_context_->GetTotalGpuMemory(bytes);
(...skipping 12 matching lines...) Expand all
107 112
108 void GLContextVirtual::SetUnbindFboOnMakeCurrent() { 113 void GLContextVirtual::SetUnbindFboOnMakeCurrent() {
109 shared_context_->SetUnbindFboOnMakeCurrent(); 114 shared_context_->SetUnbindFboOnMakeCurrent();
110 } 115 }
111 116
112 GLContextVirtual::~GLContextVirtual() { 117 GLContextVirtual::~GLContextVirtual() {
113 Destroy(); 118 Destroy();
114 } 119 }
115 120
116 } // namespace gpu 121 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gl_context_virtual.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698