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

Side by Side Diff: sky/engine/platform/graphics/GraphicsContext.cpp

Issue 1013463003: Update from https://crrev.com/320931 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « skia/ext/opacity_draw_filter.cc ('k') | sky/engine/platform/graphics/GraphicsContextState.cpp » ('j') | 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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 return; 973 return;
974 974
975 SkMatrix ctm = m_canvas->getTotalMatrix(); 975 SkMatrix ctm = m_canvas->getTotalMatrix();
976 SkRect deviceDest; 976 SkRect deviceDest;
977 ctm.mapRect(&deviceDest, dest); 977 ctm.mapRect(&deviceDest, dest);
978 SkRect sourceBounds = WebCoreFloatRectToSKRect(src); 978 SkRect sourceBounds = WebCoreFloatRectToSKRect(src);
979 979
980 RefPtr<SkPictureImageFilter> pictureFilter = adoptRef(SkPictureImageFilter:: Create(picture.get(), sourceBounds)); 980 RefPtr<SkPictureImageFilter> pictureFilter = adoptRef(SkPictureImageFilter:: Create(picture.get(), sourceBounds));
981 SkMatrix layerScale; 981 SkMatrix layerScale;
982 layerScale.setScale(deviceDest.width() / src.width(), deviceDest.height() / src.height()); 982 layerScale.setScale(deviceDest.width() / src.width(), deviceDest.height() / src.height());
983 RefPtr<SkMatrixImageFilter> matrixFilter = adoptRef(SkMatrixImageFilter::Cre ate(layerScale, SkPaint::kLow_FilterLevel, pictureFilter.get())); 983 RefPtr<SkMatrixImageFilter> matrixFilter = adoptRef(SkMatrixImageFilter::Cre ate(layerScale, kLow_SkFilterQuality, pictureFilter.get()));
984 SkPaint picturePaint; 984 SkPaint picturePaint;
985 picturePaint.setXfermodeMode(WebCoreCompositeToSkiaComposite(op, blendMode)) ; 985 picturePaint.setXfermodeMode(WebCoreCompositeToSkiaComposite(op, blendMode)) ;
986 picturePaint.setImageFilter(matrixFilter.get()); 986 picturePaint.setImageFilter(matrixFilter.get());
987 SkRect layerBounds = SkRect::MakeWH(std::max(deviceDest.width(), sourceBound s.width()), std::max(deviceDest.height(), sourceBounds.height())); 987 SkRect layerBounds = SkRect::MakeWH(std::max(deviceDest.width(), sourceBound s.width()), std::max(deviceDest.height(), sourceBounds.height()));
988 m_canvas->save(); 988 m_canvas->save();
989 m_canvas->resetMatrix(); 989 m_canvas->resetMatrix();
990 m_canvas->translate(deviceDest.x(), deviceDest.y()); 990 m_canvas->translate(deviceDest.x(), deviceDest.y());
991 m_canvas->saveLayer(&layerBounds, &picturePaint); 991 m_canvas->saveLayer(&layerBounds, &picturePaint);
992 m_canvas->restore(); 992 m_canvas->restore();
993 m_canvas->restore(); 993 m_canvas->restore();
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1784 isDataComplete); 1784 isDataComplete);
1785 } 1785 }
1786 1786
1787 if (resampling == InterpolationNone) { 1787 if (resampling == InterpolationNone) {
1788 // FIXME: This is to not break tests (it results in the filter bitmap fl ag 1788 // FIXME: This is to not break tests (it results in the filter bitmap fl ag
1789 // being set to true). We need to decide if we respect InterpolationNone 1789 // being set to true). We need to decide if we respect InterpolationNone
1790 // being returned from computeInterpolationQuality. 1790 // being returned from computeInterpolationQuality.
1791 resampling = InterpolationLow; 1791 resampling = InterpolationLow;
1792 } 1792 }
1793 resampling = limitInterpolationQuality(this, resampling); 1793 resampling = limitInterpolationQuality(this, resampling);
1794 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); 1794 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling));
1795 } 1795 }
1796 1796
1797 } // namespace blink 1797 } // namespace blink
OLDNEW
« no previous file with comments | « skia/ext/opacity_draw_filter.cc ('k') | sky/engine/platform/graphics/GraphicsContextState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698