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

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

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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef PaintRecordPattern_h 5 #ifndef PaintRecordPattern_h
6 #define PaintRecordPattern_h 6 #define PaintRecordPattern_h
7 7
8 #include "platform/geometry/FloatRect.h" 8 #include "platform/geometry/FloatRect.h"
9 #include "platform/graphics/Pattern.h" 9 #include "platform/graphics/Pattern.h"
10 #include "third_party/skia/include/core/SkRefCnt.h" 10 #include "third_party/skia/include/core/SkRefCnt.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 // TODO(enne): rename this 14 // TODO(enne): rename this
15 class PLATFORM_EXPORT PaintRecordPattern final : public Pattern { 15 class PLATFORM_EXPORT PaintRecordPattern final : public Pattern {
16 public: 16 public:
17 static PassRefPtr<PaintRecordPattern> Create(sk_sp<PaintRecord>, 17 static PassRefPtr<PaintRecordPattern> Create(sk_sp<PaintRecord>,
18 const FloatRect& record_bounds, 18 const FloatRect& record_bounds,
19 RepeatMode); 19 RepeatMode);
20 20
21 ~PaintRecordPattern() override; 21 ~PaintRecordPattern() override;
22 22
23 protected: 23 protected:
24 sk_sp<PaintShader> CreateShader(const SkMatrix&) override; 24 std::unique_ptr<PaintShader> CreateShader(const SkMatrix&) override;
25 25
26 private: 26 private:
27 PaintRecordPattern(sk_sp<PaintRecord>, 27 PaintRecordPattern(sk_sp<PaintRecord>,
28 const FloatRect& record_bounds, 28 const FloatRect& record_bounds,
29 RepeatMode); 29 RepeatMode);
30 30
31 sk_sp<PaintRecord> tile_record_; 31 sk_sp<PaintRecord> tile_record_;
32 FloatRect tile_record_bounds_; 32 FloatRect tile_record_bounds_;
33 }; 33 };
34 34
35 } // namespace blink 35 } // namespace blink
36 36
37 #endif 37 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698