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

Side by Side Diff: Source/platform/graphics/GraphicsContext.cpp

Issue 203443004: use new readPixels, as old version using Config8888 is deprecated (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months 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 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 void GraphicsContext::setColorFilter(ColorFilter colorFilter) 403 void GraphicsContext::setColorFilter(ColorFilter colorFilter)
404 { 404 {
405 GraphicsContextState* stateToSet = mutableState(); 405 GraphicsContextState* stateToSet = mutableState();
406 406
407 // We only support one active color filter at the moment. If (when) this bec omes a problem, 407 // We only support one active color filter at the moment. If (when) this bec omes a problem,
408 // we should switch to using color filter chains (Skia work in progress). 408 // we should switch to using color filter chains (Skia work in progress).
409 ASSERT(!stateToSet->colorFilter()); 409 ASSERT(!stateToSet->colorFilter());
410 stateToSet->setColorFilter(WebCoreColorFilterToSkiaColorFilter(colorFilter)) ; 410 stateToSet->setColorFilter(WebCoreColorFilterToSkiaColorFilter(colorFilter)) ;
411 } 411 }
412 412
413 bool GraphicsContext::readPixels(SkBitmap* bitmap, int x, int y, SkCanvas::Confi g8888 config8888) 413 bool GraphicsContext::readPixels(const SkImageInfo& info, void* pixels, size_t r owBytes, int x, int y)
414 { 414 {
415 if (paintingDisabled()) 415 if (paintingDisabled())
416 return false; 416 return false;
417 417
418 return m_canvas->readPixels(bitmap, x, y, config8888); 418 return m_canvas->readPixels(info, pixels, rowBytes, x, y);
419 } 419 }
420 420
421 void GraphicsContext::setMatrix(const SkMatrix& matrix) 421 void GraphicsContext::setMatrix(const SkMatrix& matrix)
422 { 422 {
423 if (paintingDisabled()) 423 if (paintingDisabled())
424 return; 424 return;
425 425
426 realizeCanvasSave(SkCanvas::kMatrix_SaveFlag); 426 realizeCanvasSave(SkCanvas::kMatrix_SaveFlag);
427 427
428 m_canvas->setMatrix(matrix); 428 m_canvas->setMatrix(matrix);
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 1915
1916 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) 1916 void GraphicsContext::didDrawTextInRect(const SkRect& textRect)
1917 { 1917 {
1918 if (m_trackTextRegion) { 1918 if (m_trackTextRegion) {
1919 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); 1919 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion");
1920 m_textRegion.join(textRect); 1920 m_textRegion.join(textRect);
1921 } 1921 }
1922 } 1922 }
1923 1923
1924 } 1924 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698