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

Side by Side Diff: ui/gl/gl_surface.cc

Issue 2888993002: Do glFinish before sending snapshot latency info to browser (Closed)
Patch Set: add current tests 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 | « ui/gl/gl_surface.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) 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 "ui/gl/gl_surface.h" 5 #include "ui/gl/gl_surface.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 183 }
184 184
185 bool GLSurface::SetDrawRectangle(const gfx::Rect& rect) { 185 bool GLSurface::SetDrawRectangle(const gfx::Rect& rect) {
186 return false; 186 return false;
187 } 187 }
188 188
189 gfx::Vector2d GLSurface::GetDrawOffset() const { 189 gfx::Vector2d GLSurface::GetDrawOffset() const {
190 return gfx::Vector2d(); 190 return gfx::Vector2d();
191 } 191 }
192 192
193 void GLSurface::WaitForSnapshotRendering() {
194 // By default, just executing the SwapBuffers is normally enough.
195 }
196
193 GLSurface* GLSurface::GetCurrent() { 197 GLSurface* GLSurface::GetCurrent() {
194 return current_surface_.Pointer()->Get(); 198 return current_surface_.Pointer()->Get();
195 } 199 }
196 200
197 GLSurface::~GLSurface() { 201 GLSurface::~GLSurface() {
198 if (GetCurrent() == this) 202 if (GetCurrent() == this)
199 SetCurrent(NULL); 203 SetCurrent(NULL);
200 } 204 }
201 205
202 void GLSurface::SetCurrent(GLSurface* surface) { 206 void GLSurface::SetCurrent(GLSurface* surface) {
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 } 386 }
383 387
384 bool GLSurfaceAdapter::SetDrawRectangle(const gfx::Rect& rect) { 388 bool GLSurfaceAdapter::SetDrawRectangle(const gfx::Rect& rect) {
385 return surface_->SetDrawRectangle(rect); 389 return surface_->SetDrawRectangle(rect);
386 } 390 }
387 391
388 gfx::Vector2d GLSurfaceAdapter::GetDrawOffset() const { 392 gfx::Vector2d GLSurfaceAdapter::GetDrawOffset() const {
389 return surface_->GetDrawOffset(); 393 return surface_->GetDrawOffset();
390 } 394 }
391 395
396 void GLSurfaceAdapter::WaitForSnapshotRendering() {
397 surface_->WaitForSnapshotRendering();
398 }
399
392 GLSurfaceAdapter::~GLSurfaceAdapter() {} 400 GLSurfaceAdapter::~GLSurfaceAdapter() {}
393 401
394 scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat( 402 scoped_refptr<GLSurface> InitializeGLSurfaceWithFormat(
395 scoped_refptr<GLSurface> surface, GLSurfaceFormat format) { 403 scoped_refptr<GLSurface> surface, GLSurfaceFormat format) {
396 if (!surface->Initialize(format)) 404 if (!surface->Initialize(format))
397 return nullptr; 405 return nullptr;
398 return surface; 406 return surface;
399 } 407 }
400 408
401 scoped_refptr<GLSurface> InitializeGLSurface(scoped_refptr<GLSurface> surface) { 409 scoped_refptr<GLSurface> InitializeGLSurface(scoped_refptr<GLSurface> surface) {
402 return InitializeGLSurfaceWithFormat(surface, GLSurfaceFormat()); 410 return InitializeGLSurfaceWithFormat(surface, GLSurfaceFormat());
403 } 411 }
404 412
405 GLSurface::CALayerInUseQuery::CALayerInUseQuery() = default; 413 GLSurface::CALayerInUseQuery::CALayerInUseQuery() = default;
406 GLSurface::CALayerInUseQuery::CALayerInUseQuery(const CALayerInUseQuery&) = 414 GLSurface::CALayerInUseQuery::CALayerInUseQuery(const CALayerInUseQuery&) =
407 default; 415 default;
408 GLSurface::CALayerInUseQuery::~CALayerInUseQuery() = default; 416 GLSurface::CALayerInUseQuery::~CALayerInUseQuery() = default;
409 417
410 } // namespace gl 418 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698