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

Side by Side Diff: services/gfx/compositor/backend/gpu_rasterizer.cc

Issue 1782733002: Mozart: The great RectF-ication. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-9
Patch Set: rebase Created 4 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "services/gfx/compositor/backend/gpu_rasterizer.h" 5 #include "services/gfx/compositor/backend/gpu_rasterizer.h"
6 6
7 #ifndef GL_GLEXT_PROTOTYPES 7 #ifndef GL_GLEXT_PROTOTYPES
8 #define GL_GLEXT_PROTOTYPES 8 #define GL_GLEXT_PROTOTYPES
9 #endif 9 #endif
10 10
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 void GpuRasterizer::Draw() { 170 void GpuRasterizer::Draw() {
171 DCHECK(gl_context_); 171 DCHECK(gl_context_);
172 DCHECK(ganesh_context_); 172 DCHECK(ganesh_context_);
173 DCHECK(frame_); 173 DCHECK(frame_);
174 174
175 gl_context_->MakeCurrent(); 175 gl_context_->MakeCurrent();
176 176
177 // Update the viewport. 177 // Update the viewport.
178 const SkRect& viewport = frame_->viewport(); 178 const SkIRect& viewport = frame_->viewport();
179 bool stale_surface = false; 179 bool stale_surface = false;
180 if (!ganesh_surface_ || 180 if (!ganesh_surface_ ||
181 ganesh_surface_->surface()->width() != viewport.width() || 181 ganesh_surface_->surface()->width() != viewport.width() ||
182 ganesh_surface_->surface()->height() != viewport.height()) { 182 ganesh_surface_->surface()->height() != viewport.height()) {
183 glResizeCHROMIUM(viewport.width(), viewport.height(), 1.0f); 183 glResizeCHROMIUM(viewport.width(), viewport.height(), 1.0f);
184 glViewport(viewport.x(), viewport.y(), viewport.width(), viewport.height()); 184 glViewport(viewport.x(), viewport.y(), viewport.width(), viewport.height());
185 stale_surface = true; 185 stale_surface = true;
186 } 186 }
187 187
188 // Paint the frame. 188 // Paint the frame.
(...skipping 12 matching lines...) Expand all
201 MGLSwapBuffers(); 201 MGLSwapBuffers();
202 frame_callback_.Run(true); 202 frame_callback_.Run(true);
203 frame_callback_.Reset(); 203 frame_callback_.Reset();
204 } 204 }
205 205
206 void GpuRasterizer::PostErrorCallback() { 206 void GpuRasterizer::PostErrorCallback() {
207 task_runner_->PostTask(FROM_HERE, error_callback_); 207 task_runner_->PostTask(FROM_HERE, error_callback_);
208 } 208 }
209 209
210 } // namespace compositor 210 } // namespace compositor
OLDNEW
« no previous file with comments | « mojo/ui/associates/view_tree_hit_tester_client_apptest.cc ('k') | services/gfx/compositor/compositor_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698