| 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) /
255.0, 1)); |
| 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 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1518 } | 1521 } |
| 1519 | 1522 |
| 1520 bool CCRendererGL::isContextLost() | 1523 bool CCRendererGL::isContextLost() |
| 1521 { | 1524 { |
| 1522 return (m_context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERRO
R); | 1525 return (m_context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERRO
R); |
| 1523 } | 1526 } |
| 1524 | 1527 |
| 1525 } // namespace cc | 1528 } // namespace cc |
| 1526 | 1529 |
| 1527 #endif // USE(ACCELERATED_COMPOSITING) | 1530 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |