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

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

Issue 551183005: [TextBlob] Fix LCD text handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: pass a bool instead of a GC Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 if (!isRecording()) 371 if (!isRecording())
372 return m_canvas->getTotalMatrix(); 372 return m_canvas->getTotalMatrix();
373 373
374 const RecordingState& recordingState = m_recordingStateStack.last(); 374 const RecordingState& recordingState = m_recordingStateStack.last();
375 SkMatrix totalMatrix = recordingState.m_savedMatrix; 375 SkMatrix totalMatrix = recordingState.m_savedMatrix;
376 totalMatrix.preConcat(m_canvas->getTotalMatrix()); 376 totalMatrix.preConcat(m_canvas->getTotalMatrix());
377 377
378 return totalMatrix; 378 return totalMatrix;
379 } 379 }
380 380
381 void GraphicsContext::adjustTextRenderMode(SkPaint* paint) 381 void GraphicsContext::adjustTextRenderMode(SkPaint* paint) const
382 { 382 {
383 if (contextDisabled()) 383 if (contextDisabled())
384 return; 384 return;
385 385
386 if (!paint->isLCDRenderText()) 386 if (!paint->isLCDRenderText())
387 return; 387 return;
388 388
389 paint->setLCDRenderText(couldUseLCDRenderedText()); 389 paint->setLCDRenderText(couldUseLCDRenderedText());
390 } 390 }
391 391
392 bool GraphicsContext::couldUseLCDRenderedText() 392 bool GraphicsContext::couldUseLCDRenderedText() const
393 { 393 {
394 // Our layers only have a single alpha channel. This means that subpixel 394 // Our layers only have a single alpha channel. This means that subpixel
395 // rendered text cannot be composited correctly when the layer is 395 // rendered text cannot be composited correctly when the layer is
396 // collapsed. Therefore, subpixel text is contextDisabled when we are drawin g 396 // collapsed. Therefore, subpixel text is contextDisabled when we are drawin g
397 // onto a layer. 397 // onto a layer.
398 if (contextDisabled() || m_canvas->isDrawingToLayer() || !isCertainlyOpaque( )) 398 if (contextDisabled() || m_canvas->isDrawingToLayer() || !isCertainlyOpaque( ))
399 return false; 399 return false;
400 400
401 return shouldSmoothFonts(); 401 return shouldSmoothFonts();
402 } 402 }
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1980 // FIXME: This is to not break tests (it results in the filter bitmap fl ag 1980 // FIXME: This is to not break tests (it results in the filter bitmap fl ag
1981 // being set to true). We need to decide if we respect InterpolationNone 1981 // being set to true). We need to decide if we respect InterpolationNone
1982 // being returned from computeInterpolationQuality. 1982 // being returned from computeInterpolationQuality.
1983 resampling = InterpolationLow; 1983 resampling = InterpolationLow;
1984 } 1984 }
1985 resampling = limitInterpolationQuality(this, resampling); 1985 resampling = limitInterpolationQuality(this, resampling);
1986 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); 1986 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling));
1987 } 1987 }
1988 1988
1989 } // namespace blink 1989 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698