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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 | 374 |
375 paint->setLCDRenderText(couldUseLCDRenderedText()); | 375 paint->setLCDRenderText(couldUseLCDRenderedText()); |
376 } | 376 } |
377 | 377 |
378 bool GraphicsContext::couldUseLCDRenderedText() | 378 bool GraphicsContext::couldUseLCDRenderedText() |
379 { | 379 { |
380 // Our layers only have a single alpha channel. This means that subpixel | 380 // Our layers only have a single alpha channel. This means that subpixel |
381 // rendered text cannot be composited correctly when the layer is | 381 // rendered text cannot be composited correctly when the layer is |
382 // collapsed. Therefore, subpixel text is contextDisabled when we are drawin
g | 382 // collapsed. Therefore, subpixel text is contextDisabled when we are drawin
g |
383 // onto a layer. | 383 // onto a layer. |
384 if (contextDisabled() || isDrawingToLayer() || !isCertainlyOpaque()) | 384 if (contextDisabled() || m_canvas->isDrawingToLayer() || !isCertainlyOpaque(
)) |
385 return false; | 385 return false; |
386 | 386 |
387 return shouldSmoothFonts(); | 387 return shouldSmoothFonts(); |
388 } | 388 } |
389 | 389 |
390 void GraphicsContext::setCompositeOperation(CompositeOperator compositeOperation
, WebBlendMode blendMode) | 390 void GraphicsContext::setCompositeOperation(CompositeOperator compositeOperation
, WebBlendMode blendMode) |
391 { | 391 { |
392 if (contextDisabled()) | 392 if (contextDisabled()) |
393 return; | 393 return; |
394 mutableState()->setCompositeOperation(compositeOperation, blendMode); | 394 mutableState()->setCompositeOperation(compositeOperation, blendMode); |
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1817 | 1817 |
1818 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) | 1818 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) |
1819 { | 1819 { |
1820 if (m_trackTextRegion) { | 1820 if (m_trackTextRegion) { |
1821 TRACE_EVENT0("skia", "GraphicsContext::didDrawTextInRect"); | 1821 TRACE_EVENT0("skia", "GraphicsContext::didDrawTextInRect"); |
1822 m_textRegion.join(textRect); | 1822 m_textRegion.join(textRect); |
1823 } | 1823 } |
1824 } | 1824 } |
1825 | 1825 |
1826 } | 1826 } |
OLD | NEW |