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

Side by Side Diff: cc/software_renderer.cc

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Apply code review comments Created 8 years, 1 month 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
« no previous file with comments | « cc/single_thread_proxy.cc ('k') | cc/software_renderer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/debug_border_draw_quad.h" 9 #include "cc/debug_border_draw_quad.h"
10 #include "cc/render_pass_draw_quad.h" 10 #include "cc/render_pass_draw_quad.h"
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 341
342 void SoftwareRenderer::drawUnsupportedQuad(const DrawingFrame& frame, const Draw Quad* quad) 342 void SoftwareRenderer::drawUnsupportedQuad(const DrawingFrame& frame, const Draw Quad* quad)
343 { 343 {
344 m_skCurrentPaint.setColor(SK_ColorMAGENTA); 344 m_skCurrentPaint.setColor(SK_ColorMAGENTA);
345 m_skCurrentPaint.setAlpha(quad->opacity() * 255); 345 m_skCurrentPaint.setAlpha(quad->opacity() * 255);
346 m_skCurrentCanvas->drawRect(toSkRect(quadVertexRect()), m_skCurrentPaint); 346 m_skCurrentCanvas->drawRect(toSkRect(quadVertexRect()), m_skCurrentPaint);
347 } 347 }
348 348
349 bool SoftwareRenderer::swapBuffers() 349 bool SoftwareRenderer::swapBuffers()
350 { 350 {
351 if (Proxy::hasImplThread()) 351 if (m_client->hasImplThread())
352 m_client->onSwapBuffersComplete(); 352 m_client->onSwapBuffersComplete();
353 return true; 353 return true;
354 } 354 }
355 355
356 void SoftwareRenderer::getFramebufferPixels(void *pixels, const gfx::Rect& rect) 356 void SoftwareRenderer::getFramebufferPixels(void *pixels, const gfx::Rect& rect)
357 { 357 {
358 SkBitmap fullBitmap = m_outputDevice->lock(false)->getSkBitmap(); 358 SkBitmap fullBitmap = m_outputDevice->lock(false)->getSkBitmap();
359 SkBitmap subsetBitmap; 359 SkBitmap subsetBitmap;
360 SkIRect invertRect = SkIRect::MakeXYWH(rect.x(), viewportSize().height() - r ect.bottom(), rect.width(), rect.height()); 360 SkIRect invertRect = SkIRect::MakeXYWH(rect.x(), viewportSize().height() - r ect.bottom(), rect.width(), rect.height());
361 fullBitmap.extractSubset(&subsetBitmap, invertRect); 361 fullBitmap.extractSubset(&subsetBitmap, invertRect);
362 subsetBitmap.copyPixelsTo(pixels, rect.width() * rect.height() * 4, rect.wid th() * 4); 362 subsetBitmap.copyPixelsTo(pixels, rect.width() * rect.height() * 4, rect.wid th() * 4);
363 m_outputDevice->unlock(); 363 m_outputDevice->unlock();
364 } 364 }
365 365
366 void SoftwareRenderer::setVisible(bool visible) 366 void SoftwareRenderer::setVisible(bool visible)
367 { 367 {
368 if (m_visible == visible) 368 if (m_visible == visible)
369 return; 369 return;
370 m_visible = visible; 370 m_visible = visible;
371 } 371 }
372 372
373 } // namespace cc 373 } // namespace cc
OLDNEW
« no previous file with comments | « cc/single_thread_proxy.cc ('k') | cc/software_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698