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

Side by Side Diff: cc/CCRendererGL.cpp

Issue 11051029: [cc] Fix zebra-stripe compositor checkerboarding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 5
6 #include "config.h" 6 #include "config.h"
7 7
8 #if USE(ACCELERATED_COMPOSITING) 8 #if USE(ACCELERATED_COMPOSITING)
9 #include "CCRendererGL.h" 9 #include "CCRendererGL.h"
10 10
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 void CCRendererGL::drawCheckerboardQuad(const DrawingFrame& frame, const CCCheck erboardDrawQuad* quad) 281 void CCRendererGL::drawCheckerboardQuad(const DrawingFrame& frame, const CCCheck erboardDrawQuad* quad)
282 { 282 {
283 const TileCheckerboardProgram* program = tileCheckerboardProgram(); 283 const TileCheckerboardProgram* program = tileCheckerboardProgram();
284 ASSERT(program && program->initialized()); 284 ASSERT(program && program->initialized());
285 GLC(context(), context()->useProgram(program->program())); 285 GLC(context(), context()->useProgram(program->program()));
286 286
287 SkColor color = quad->color(); 287 SkColor color = quad->color();
288 GLC(context(), context()->uniform4f(program->fragmentShader().colorLocation( ), SkColorGetR(color) / 255.0, SkColorGetG(color) / 255.0, SkColorGetB(color) / 255.0, 1)); 288 GLC(context(), context()->uniform4f(program->fragmentShader().colorLocation( ), SkColorGetR(color) / 255.0, SkColorGetG(color) / 255.0, SkColorGetB(color) / 255.0, 1));
289 289
290 const int checkerboardWidth = 16;
291 float frequency = 1.0 / checkerboardWidth;
292
290 IntRect tileRect = quad->quadRect(); 293 IntRect tileRect = quad->quadRect();
291 float texOffsetX = tileRect.x(); 294 float texOffsetX = tileRect.x() % checkerboardWidth;
292 float texOffsetY = tileRect.y(); 295 float texOffsetY = tileRect.y() % checkerboardWidth;
293 float texScaleX = tileRect.width(); 296 float texScaleX = tileRect.width();
294 float texScaleY = tileRect.height(); 297 float texScaleY = tileRect.height();
295 GLC(context(), context()->uniform4f(program->fragmentShader().texTransformLo cation(), texOffsetX, texOffsetY, texScaleX, texScaleY)); 298 GLC(context(), context()->uniform4f(program->fragmentShader().texTransformLo cation(), texOffsetX, texOffsetY, texScaleX, texScaleY));
296 299
297 const int checkerboardWidth = 16;
298 float frequency = 1.0 / checkerboardWidth;
299
300 GLC(context(), context()->uniform1f(program->fragmentShader().frequencyLocat ion(), frequency)); 300 GLC(context(), context()->uniform1f(program->fragmentShader().frequencyLocat ion(), frequency));
301 301
302 setShaderOpacity(quad->opacity(), program->fragmentShader().alphaLocation()) ; 302 setShaderOpacity(quad->opacity(), program->fragmentShader().alphaLocation()) ;
303 drawQuadGeometry(frame, quad->quadTransform(), quad->quadRect(), program->ve rtexShader().matrixLocation()); 303 drawQuadGeometry(frame, quad->quadTransform(), quad->quadRect(), program->ve rtexShader().matrixLocation());
304 } 304 }
305 305
306 void CCRendererGL::drawDebugBorderQuad(const DrawingFrame& frame, const CCDebugB orderDrawQuad* quad) 306 void CCRendererGL::drawDebugBorderQuad(const DrawingFrame& frame, const CCDebugB orderDrawQuad* quad)
307 { 307 {
308 static float glMatrix[16]; 308 static float glMatrix[16];
309 const SolidColorProgram* program = solidColorProgram(); 309 const SolidColorProgram* program = solidColorProgram();
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 } 1521 }
1522 1522
1523 bool CCRendererGL::isContextLost() 1523 bool CCRendererGL::isContextLost()
1524 { 1524 {
1525 return (m_context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERRO R); 1525 return (m_context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERRO R);
1526 } 1526 }
1527 1527
1528 } // namespace cc 1528 } // namespace cc
1529 1529
1530 #endif // USE(ACCELERATED_COMPOSITING) 1530 #endif // USE(ACCELERATED_COMPOSITING)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698