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

Side by Side Diff: Source/modules/canvas2d/CanvasRenderingContext2DState.cpp

Issue 1234923002: Revert of https://codereview.chromium.org/1176073003/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « LayoutTests/TestExpectations ('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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "modules/canvas2d/CanvasRenderingContext2DState.h" 7 #include "modules/canvas2d/CanvasRenderingContext2DState.h"
8 8
9 #include "core/css/CSSFontSelector.h" 9 #include "core/css/CSSFontSelector.h"
10 #include "core/css/resolver/FilterOperationResolver.h" 10 #include "core/css/resolver/FilterOperationResolver.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 { 451 {
452 SkXfermode* xferMode = m_strokePaint.getXfermode(); 452 SkXfermode* xferMode = m_strokePaint.getXfermode();
453 SkXfermode::Mode mode; 453 SkXfermode::Mode mode;
454 if (!xferMode || !xferMode->asMode(&mode)) 454 if (!xferMode || !xferMode->asMode(&mode))
455 return SkXfermode::kSrcOver_Mode; 455 return SkXfermode::kSrcOver_Mode;
456 return mode; 456 return mode;
457 } 457 }
458 458
459 void CanvasRenderingContext2DState::setImageSmoothingEnabled(bool enabled) 459 void CanvasRenderingContext2DState::setImageSmoothingEnabled(bool enabled)
460 { 460 {
461 SkFilterQuality filterQuality = enabled ? kMedium_SkFilterQuality : kNone_Sk FilterQuality; 461 SkFilterQuality filterQuality = enabled ? kLow_SkFilterQuality : kNone_SkFil terQuality;
462 m_strokePaint.setFilterQuality(filterQuality); 462 m_strokePaint.setFilterQuality(filterQuality);
463 m_fillPaint.setFilterQuality(filterQuality); 463 m_fillPaint.setFilterQuality(filterQuality);
464 m_imagePaint.setFilterQuality(filterQuality); 464 m_imagePaint.setFilterQuality(filterQuality);
465 } 465 }
466 466
467 bool CanvasRenderingContext2DState::imageSmoothingEnabled() const 467 bool CanvasRenderingContext2DState::imageSmoothingEnabled() const
468 { 468 {
469 return m_imagePaint.getFilterQuality() == kMedium_SkFilterQuality; 469 return m_imagePaint.getFilterQuality() == kLow_SkFilterQuality;
470 } 470 }
471 471
472 bool CanvasRenderingContext2DState::shouldDrawShadows() const 472 bool CanvasRenderingContext2DState::shouldDrawShadows() const
473 { 473 {
474 return alphaChannel(m_shadowColor) && (m_shadowBlur || !m_shadowOffset.isZer o()); 474 return alphaChannel(m_shadowColor) && (m_shadowBlur || !m_shadowOffset.isZer o());
475 } 475 }
476 476
477 const SkPaint* CanvasRenderingContext2DState::getPaint(PaintType paintType, Shad owMode shadowMode, ImageType imageType) const 477 const SkPaint* CanvasRenderingContext2DState::getPaint(PaintType paintType, Shad owMode shadowMode, ImageType imageType) const
478 { 478 {
479 SkPaint* paint; 479 SkPaint* paint;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 paint->setLooper(0); 523 paint->setLooper(0);
524 paint->setImageFilter(shadowAndForegroundImageFilter()); 524 paint->setImageFilter(shadowAndForegroundImageFilter());
525 return paint; 525 return paint;
526 } 526 }
527 paint->setLooper(shadowAndForegroundDrawLooper()); 527 paint->setLooper(shadowAndForegroundDrawLooper());
528 paint->setImageFilter(0); 528 paint->setImageFilter(0);
529 return paint; 529 return paint;
530 } 530 }
531 531
532 } // blink 532 } // blink
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698