OLD | NEW |
---|---|
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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
277 break; | 277 break; |
278 } | 278 } |
279 } | 279 } |
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(); | |
288 GLC(context(), context()->uniform4f(program->fragmentShader().colorLocation( ), SkColorGetR(color) / 255.0, SkColorGetG(color) / 255.0, SkColorGetB(color), 1 )); | |
jamesr
2012/09/21 22:28:08
why are you dividing red and green by 255.0 but le
| |
289 | |
287 IntRect tileRect = quad->quadRect(); | 290 IntRect tileRect = quad->quadRect(); |
288 float texOffsetX = tileRect.x(); | 291 float texOffsetX = tileRect.x(); |
289 float texOffsetY = tileRect.y(); | 292 float texOffsetY = tileRect.y(); |
290 float texScaleX = tileRect.width(); | 293 float texScaleX = tileRect.width(); |
291 float texScaleY = tileRect.height(); | 294 float texScaleY = tileRect.height(); |
292 GLC(context(), context()->uniform4f(program->fragmentShader().texTransformLo cation(), texOffsetX, texOffsetY, texScaleX, texScaleY)); | 295 GLC(context(), context()->uniform4f(program->fragmentShader().texTransformLo cation(), texOffsetX, texOffsetY, texScaleX, texScaleY)); |
293 | 296 |
294 const int checkerboardWidth = 16; | 297 const int checkerboardWidth = 16; |
295 float frequency = 1.0 / checkerboardWidth; | 298 float frequency = 1.0 / checkerboardWidth; |
296 | 299 |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1513 } | 1516 } |
1514 | 1517 |
1515 bool CCRendererGL::isContextLost() | 1518 bool CCRendererGL::isContextLost() |
1516 { | 1519 { |
1517 return (m_context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERRO R); | 1520 return (m_context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERRO R); |
1518 } | 1521 } |
1519 | 1522 |
1520 } // namespace cc | 1523 } // namespace cc |
1521 | 1524 |
1522 #endif // USE(ACCELERATED_COMPOSITING) | 1525 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |