OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/software_renderer.h" | 7 #include "cc/software_renderer.h" |
8 | 8 |
9 #include "CCDebugBorderDrawQuad.h" | 9 #include "CCDebugBorderDrawQuad.h" |
10 #include "cc/render_pass_draw_quad.h" | 10 #include "cc/render_pass_draw_quad.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 325 |
326 void CCRendererSoftware::drawUnsupportedQuad(const DrawingFrame& frame, const CC
DrawQuad* quad) | 326 void CCRendererSoftware::drawUnsupportedQuad(const DrawingFrame& frame, const CC
DrawQuad* quad) |
327 { | 327 { |
328 m_skCurrentPaint.setColor(SK_ColorMAGENTA); | 328 m_skCurrentPaint.setColor(SK_ColorMAGENTA); |
329 m_skCurrentPaint.setAlpha(quad->opacity() * 255); | 329 m_skCurrentPaint.setAlpha(quad->opacity() * 255); |
330 m_skCurrentCanvas->drawRect(toSkRect(quadVertexRect()), m_skCurrentPaint); | 330 m_skCurrentCanvas->drawRect(toSkRect(quadVertexRect()), m_skCurrentPaint); |
331 } | 331 } |
332 | 332 |
333 bool CCRendererSoftware::swapBuffers() | 333 bool CCRendererSoftware::swapBuffers() |
334 { | 334 { |
335 if (CCProxy::hasImplThread()) | 335 if (m_proxy->hasImplThread()) |
336 m_client->onSwapBuffersComplete(); | 336 m_client->onSwapBuffersComplete(); |
337 return true; | 337 return true; |
338 } | 338 } |
339 | 339 |
340 void CCRendererSoftware::getFramebufferPixels(void *pixels, const IntRect& rect) | 340 void CCRendererSoftware::getFramebufferPixels(void *pixels, const IntRect& rect) |
341 { | 341 { |
342 SkBitmap fullBitmap = m_outputDevice->lock(false)->getSkBitmap(); | 342 SkBitmap fullBitmap = m_outputDevice->lock(false)->getSkBitmap(); |
343 SkBitmap subsetBitmap; | 343 SkBitmap subsetBitmap; |
344 SkIRect invertRect = SkIRect::MakeXYWH(rect.x(), viewportSize().height() - r
ect.maxY(), rect.width(), rect.height()); | 344 SkIRect invertRect = SkIRect::MakeXYWH(rect.x(), viewportSize().height() - r
ect.maxY(), rect.width(), rect.height()); |
345 fullBitmap.extractSubset(&subsetBitmap, invertRect); | 345 fullBitmap.extractSubset(&subsetBitmap, invertRect); |
346 subsetBitmap.copyPixelsTo(pixels, rect.width() * rect.height() * 4, rect.wid
th() * 4); | 346 subsetBitmap.copyPixelsTo(pixels, rect.width() * rect.height() * 4, rect.wid
th() * 4); |
347 m_outputDevice->unlock(); | 347 m_outputDevice->unlock(); |
348 } | 348 } |
349 | 349 |
350 void CCRendererSoftware::setVisible(bool visible) | 350 void CCRendererSoftware::setVisible(bool visible) |
351 { | 351 { |
352 if (m_visible == visible) | 352 if (m_visible == visible) |
353 return; | 353 return; |
354 m_visible = visible; | 354 m_visible = visible; |
355 } | 355 } |
356 | 356 |
357 } | 357 } |
OLD | NEW |