OLD | NEW |
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 Loading... |
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 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1885 | 1885 |
1886 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) | 1886 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) |
1887 { | 1887 { |
1888 if (m_trackTextRegion) { | 1888 if (m_trackTextRegion) { |
1889 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); | 1889 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); |
1890 m_textRegion.join(textRect); | 1890 m_textRegion.join(textRect); |
1891 } | 1891 } |
1892 } | 1892 } |
1893 | 1893 |
1894 } | 1894 } |
OLD | NEW |