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: Rebase to 165064 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
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 void SoftwareRenderer::drawUnsupportedQuad(const DrawingFrame& frame, const Draw Quad* quad) 333 void SoftwareRenderer::drawUnsupportedQuad(const DrawingFrame& frame, const Draw Quad* quad)
334 { 334 {
335 m_skCurrentPaint.setColor(SK_ColorMAGENTA); 335 m_skCurrentPaint.setColor(SK_ColorMAGENTA);
336 m_skCurrentPaint.setAlpha(quad->opacity() * 255); 336 m_skCurrentPaint.setAlpha(quad->opacity() * 255);
337 m_skCurrentCanvas->drawRect(toSkRect(quadVertexRect()), m_skCurrentPaint); 337 m_skCurrentCanvas->drawRect(toSkRect(quadVertexRect()), m_skCurrentPaint);
338 } 338 }
339 339
340 bool SoftwareRenderer::swapBuffers() 340 bool SoftwareRenderer::swapBuffers()
341 { 341 {
342 if (Proxy::hasImplThread()) 342 if (m_client->hasImplThread())
343 m_client->onSwapBuffersComplete(); 343 m_client->onSwapBuffersComplete();
344 return true; 344 return true;
345 } 345 }
346 346
347 void SoftwareRenderer::getFramebufferPixels(void *pixels, const IntRect& rect) 347 void SoftwareRenderer::getFramebufferPixels(void *pixels, const IntRect& rect)
348 { 348 {
349 SkBitmap fullBitmap = m_outputDevice->lock(false)->getSkBitmap(); 349 SkBitmap fullBitmap = m_outputDevice->lock(false)->getSkBitmap();
350 SkBitmap subsetBitmap; 350 SkBitmap subsetBitmap;
351 SkIRect invertRect = SkIRect::MakeXYWH(rect.x(), viewportSize().height() - r ect.maxY(), rect.width(), rect.height()); 351 SkIRect invertRect = SkIRect::MakeXYWH(rect.x(), viewportSize().height() - r ect.maxY(), rect.width(), rect.height());
352 fullBitmap.extractSubset(&subsetBitmap, invertRect); 352 fullBitmap.extractSubset(&subsetBitmap, invertRect);
353 subsetBitmap.copyPixelsTo(pixels, rect.width() * rect.height() * 4, rect.wid th() * 4); 353 subsetBitmap.copyPixelsTo(pixels, rect.width() * rect.height() * 4, rect.wid th() * 4);
354 m_outputDevice->unlock(); 354 m_outputDevice->unlock();
355 } 355 }
356 356
357 void SoftwareRenderer::setVisible(bool visible) 357 void SoftwareRenderer::setVisible(bool visible)
358 { 358 {
359 if (m_visible == visible) 359 if (m_visible == visible)
360 return; 360 return;
361 m_visible = visible; 361 m_visible = visible;
362 } 362 }
363 363
364 } 364 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698