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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp

Issue 2893083002: cc: Move SkShader construction to a single spot in PaintShader (Closed)
Patch Set: update Created 3 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "modules/canvas2d/BaseRenderingContext2D.h" 5 #include "modules/canvas2d/BaseRenderingContext2D.h"
6 6
7 #include "bindings/core/v8/ExceptionMessages.h" 7 #include "bindings/core/v8/ExceptionMessages.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "core/css/cssom/CSSURLImageValue.h" 9 #include "core/css/cssom/CSSURLImageValue.h"
10 #include "core/css/parser/CSSParser.h" 10 #include "core/css/parser/CSSParser.h"
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 is_source_over = mode == SkBlendMode::kSrcOver; 1824 is_source_over = mode == SkBlendMode::kSrcOver;
1825 if (!is_source_over && mode != SkBlendMode::kSrc && 1825 if (!is_source_over && mode != SkBlendMode::kSrc &&
1826 mode != SkBlendMode::kClear) 1826 mode != SkBlendMode::kClear)
1827 return; // The code below only knows how to handle Src, SrcOver, and 1827 return; // The code below only knows how to handle Src, SrcOver, and
1828 // Clear 1828 // Clear
1829 1829
1830 alpha = flags->getAlpha(); 1830 alpha = flags->getAlpha();
1831 1831
1832 if (is_source_over && 1832 if (is_source_over &&
1833 image_type == CanvasRenderingContext2DState::kNoImage) { 1833 image_type == CanvasRenderingContext2DState::kNoImage) {
1834 PaintShader* shader = flags->getShader(); 1834 if (flags->HasShader()) {
1835 if (shader) { 1835 if (flags->ShaderIsOpaque() && alpha == 0xFF)
1836 if (shader->isOpaque() && alpha == 0xFF)
1837 GetImageBuffer()->WillOverwriteCanvas(); 1836 GetImageBuffer()->WillOverwriteCanvas();
1838 return; 1837 return;
1839 } 1838 }
1840 } 1839 }
1841 } 1840 }
1842 1841
1843 if (is_source_over) { 1842 if (is_source_over) {
1844 // With source over, we need to certify that alpha == 0xFF for all pixels 1843 // With source over, we need to certify that alpha == 0xFF for all pixels
1845 if (image_type == CanvasRenderingContext2DState::kNonOpaqueImage) 1844 if (image_type == CanvasRenderingContext2DState::kNonOpaqueImage)
1846 return; 1845 return;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 num_filters(0), 1877 num_filters(0),
1879 num_get_image_data_calls(0), 1878 num_get_image_data_calls(0),
1880 area_get_image_data_calls(0.0), 1879 area_get_image_data_calls(0.0),
1881 num_put_image_data_calls(0), 1880 num_put_image_data_calls(0),
1882 area_put_image_data_calls(0.0), 1881 area_put_image_data_calls(0.0),
1883 num_clear_rect_calls(0), 1882 num_clear_rect_calls(0),
1884 num_draw_focus_calls(0), 1883 num_draw_focus_calls(0),
1885 num_frames_since_reset(0) {} 1884 num_frames_since_reset(0) {}
1886 1885
1887 } // namespace blink 1886 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp ('k') | third_party/WebKit/Source/platform/graphics/Gradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698