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

Side by Side Diff: content/browser/renderer_host/compositing_iosurface_mac.mm

Issue 134753008: Performance fixes for CoreAnimation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use observer Created 6 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | 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 "content/browser/renderer_host/compositing_iosurface_mac.h" 5 #include "content/browser/renderer_host/compositing_iosurface_mac.h"
6 6
7 #include <OpenGL/CGLRenderers.h> 7 #include <OpenGL/CGLRenderers.h>
8 #include <OpenGL/OpenGL.h> 8 #include <OpenGL/OpenGL.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 return true; 623 return true;
624 } 624 }
625 625
626 void CompositingIOSurfaceMac::UnrefIOSurface() { 626 void CompositingIOSurfaceMac::UnrefIOSurface() {
627 CGLSetCurrentContext(offscreen_context_->cgl_context()); 627 CGLSetCurrentContext(offscreen_context_->cgl_context());
628 UnrefIOSurfaceWithContextCurrent(); 628 UnrefIOSurfaceWithContextCurrent();
629 CGLSetCurrentContext(0); 629 CGLSetCurrentContext(0);
630 } 630 }
631 631
632 void CompositingIOSurfaceMac::DrawQuad(const SurfaceQuad& quad) { 632 void CompositingIOSurfaceMac::DrawQuad(const SurfaceQuad& quad) {
633 TRACE_EVENT0("gpu", "CompositingIOSurfaceMac::DrawQuad");
634
633 glEnableClientState(GL_VERTEX_ARRAY); CHECK_AND_SAVE_GL_ERROR(); 635 glEnableClientState(GL_VERTEX_ARRAY); CHECK_AND_SAVE_GL_ERROR();
634 glEnableClientState(GL_TEXTURE_COORD_ARRAY); CHECK_AND_SAVE_GL_ERROR(); 636 glEnableClientState(GL_TEXTURE_COORD_ARRAY); CHECK_AND_SAVE_GL_ERROR();
635 637
636 glVertexPointer(2, GL_FLOAT, sizeof(SurfaceVertex), &quad.verts_[0].x_); 638 glVertexPointer(2, GL_FLOAT, sizeof(SurfaceVertex), &quad.verts_[0].x_);
637 glTexCoordPointer(2, GL_FLOAT, sizeof(SurfaceVertex), &quad.verts_[0].tx_); 639 glTexCoordPointer(2, GL_FLOAT, sizeof(SurfaceVertex), &quad.verts_[0].tx_);
638 glDrawArrays(GL_QUADS, 0, 4); CHECK_AND_SAVE_GL_ERROR(); 640 glDrawArrays(GL_QUADS, 0, 4); CHECK_AND_SAVE_GL_ERROR();
639 641
640 glDisableClientState(GL_VERTEX_ARRAY); 642 glDisableClientState(GL_VERTEX_ARRAY);
641 glDisableClientState(GL_TEXTURE_COORD_ARRAY); 643 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
642 } 644 }
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 } 1037 }
1036 1038
1037 GLenum CompositingIOSurfaceMac::GetAndSaveGLError() { 1039 GLenum CompositingIOSurfaceMac::GetAndSaveGLError() {
1038 GLenum gl_error = glGetError(); 1040 GLenum gl_error = glGetError();
1039 if (gl_error_ == GL_NO_ERROR) 1041 if (gl_error_ == GL_NO_ERROR)
1040 gl_error_ = gl_error; 1042 gl_error_ = gl_error;
1041 return gl_error; 1043 return gl_error;
1042 } 1044 }
1043 1045
1044 } // namespace content 1046 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698