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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Pattern.h

Issue 2889653002: Remove cullRect() from PaintOpBuffer. (Closed)
Patch Set: movecullrect2 rebase-once-and-for-all Created 3 years, 7 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
4 * Copyright (C) 2007-2008 Torch Mobile, Inc. 4 * Copyright (C) 2007-2008 Torch Mobile, Inc.
5 * Copyright (C) 2013 Google, Inc. All rights reserved. 5 * Copyright (C) 2013 Google, Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 kRepeatModeY = 1 << 1, 52 kRepeatModeY = 1 << 1,
53 53
54 kRepeatModeNone = 0, 54 kRepeatModeNone = 0,
55 kRepeatModeXY = kRepeatModeX | kRepeatModeY 55 kRepeatModeXY = kRepeatModeX | kRepeatModeY
56 }; 56 };
57 57
58 static PassRefPtr<Pattern> CreateImagePattern(PassRefPtr<Image>, 58 static PassRefPtr<Pattern> CreateImagePattern(PassRefPtr<Image>,
59 RepeatMode = kRepeatModeXY); 59 RepeatMode = kRepeatModeXY);
60 static PassRefPtr<Pattern> CreatePaintRecordPattern( 60 static PassRefPtr<Pattern> CreatePaintRecordPattern(
61 sk_sp<PaintRecord>, 61 sk_sp<PaintRecord>,
62 const FloatRect& record_bounds,
62 RepeatMode = kRepeatModeXY); 63 RepeatMode = kRepeatModeXY);
63 virtual ~Pattern(); 64 virtual ~Pattern();
64 65
65 void ApplyToFlags(PaintFlags&, const SkMatrix&); 66 void ApplyToFlags(PaintFlags&, const SkMatrix&);
66 67
67 bool IsRepeatX() const { return repeat_mode_ & kRepeatModeX; } 68 bool IsRepeatX() const { return repeat_mode_ & kRepeatModeX; }
68 bool IsRepeatY() const { return repeat_mode_ & kRepeatModeY; } 69 bool IsRepeatY() const { return repeat_mode_ & kRepeatModeY; }
69 bool IsRepeatXY() const { return repeat_mode_ == kRepeatModeXY; } 70 bool IsRepeatXY() const { return repeat_mode_ == kRepeatModeXY; }
70 71
71 virtual bool IsTextureBacked() const { return false; } 72 virtual bool IsTextureBacked() const { return false; }
72 73
73 protected: 74 protected:
74 virtual sk_sp<PaintShader> CreateShader(const SkMatrix&) = 0; 75 virtual sk_sp<PaintShader> CreateShader(const SkMatrix&) = 0;
75 virtual bool IsLocalMatrixChanged(const SkMatrix&) const; 76 virtual bool IsLocalMatrixChanged(const SkMatrix&) const;
76 77
77 RepeatMode repeat_mode_; 78 RepeatMode repeat_mode_;
78 79
79 Pattern(RepeatMode); 80 Pattern(RepeatMode);
80 mutable sk_sp<PaintShader> cached_shader_; 81 mutable sk_sp<PaintShader> cached_shader_;
81 }; 82 };
82 83
83 } // namespace blink 84 } // namespace blink
84 85
85 #endif 86 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698