OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 GraphicsContext context(*paint_controller); | 52 GraphicsContext context(*paint_controller); |
53 context.BeginRecording(tile_rect); | 53 context.BeginRecording(tile_rect); |
54 DrawTile(context, src_rect); | 54 DrawTile(context, src_rect); |
55 sk_sp<PaintRecord> record = context.EndRecording(); | 55 sk_sp<PaintRecord> record = context.EndRecording(); |
56 | 56 |
57 SkMatrix pattern_matrix = SkMatrix::MakeTrans(phase.X(), phase.Y()); | 57 SkMatrix pattern_matrix = SkMatrix::MakeTrans(phase.X(), phase.Y()); |
58 pattern_matrix.preScale(scale.Width(), scale.Height()); | 58 pattern_matrix.preScale(scale.Width(), scale.Height()); |
59 pattern_matrix.preTranslate(tile_rect.X(), tile_rect.Y()); | 59 pattern_matrix.preTranslate(tile_rect.X(), tile_rect.Y()); |
60 | 60 |
61 RefPtr<Pattern> pattern = | 61 RefPtr<Pattern> pattern = |
62 Pattern::CreatePaintRecordPattern(std::move(record)); | 62 Pattern::CreatePaintRecordPattern(std::move(record), tile_rect); |
63 | 63 |
64 PaintFlags fill_flags = dest_context.FillFlags(); | 64 PaintFlags fill_flags = dest_context.FillFlags(); |
65 pattern->ApplyToFlags(fill_flags, pattern_matrix); | 65 pattern->ApplyToFlags(fill_flags, pattern_matrix); |
66 fill_flags.setColor(SK_ColorBLACK); | 66 fill_flags.setColor(SK_ColorBLACK); |
67 fill_flags.setBlendMode(composite_op); | 67 fill_flags.setBlendMode(composite_op); |
68 | 68 |
69 dest_context.DrawRect(dest_rect, fill_flags); | 69 dest_context.DrawRect(dest_rect, fill_flags); |
70 } | 70 } |
71 | 71 |
72 sk_sp<SkImage> GeneratedImage::ImageForCurrentFrame() { | 72 sk_sp<SkImage> GeneratedImage::ImageForCurrentFrame() { |
73 return nullptr; | 73 return nullptr; |
74 } | 74 } |
75 | 75 |
76 } // namespace blink | 76 } // namespace blink |
OLD | NEW |