OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 setIsHidden(false); | 47 setIsHidden(false); |
48 } | 48 } |
49 | 49 |
50 ImageBufferSurface::~ImageBufferSurface() {} | 50 ImageBufferSurface::~ImageBufferSurface() {} |
51 | 51 |
52 sk_sp<SkPicture> ImageBufferSurface::getPicture() { | 52 sk_sp<SkPicture> ImageBufferSurface::getPicture() { |
53 return nullptr; | 53 return nullptr; |
54 } | 54 } |
55 | 55 |
56 void ImageBufferSurface::clear() { | 56 void ImageBufferSurface::clear() { |
57 // Clear the background transparent or opaque, as required. It would be nice i
f this wasn't | 57 // Clear the background transparent or opaque, as required. It would be nice |
58 // required, but the canvas is currently filled with the magic transparency | 58 // if this wasn't required, but the canvas is currently filled with the magic |
59 // color. Can we have another way to manage this? | 59 // transparency color. Can we have another way to manage this? |
60 if (isValid()) { | 60 if (isValid()) { |
61 if (m_opacityMode == Opaque) { | 61 if (m_opacityMode == Opaque) { |
62 canvas()->clear(SK_ColorBLACK); | 62 canvas()->clear(SK_ColorBLACK); |
63 } else { | 63 } else { |
64 canvas()->clear(SK_ColorTRANSPARENT); | 64 canvas()->clear(SK_ColorTRANSPARENT); |
65 } | 65 } |
66 didDraw(FloatRect(FloatPoint(0, 0), FloatSize(size()))); | 66 didDraw(FloatRect(FloatPoint(0, 0), FloatSize(size()))); |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
(...skipping 16 matching lines...) Expand all Loading... |
86 | 86 |
87 bool ImageBufferSurface::writePixels(const SkImageInfo& origInfo, | 87 bool ImageBufferSurface::writePixels(const SkImageInfo& origInfo, |
88 const void* pixels, | 88 const void* pixels, |
89 size_t rowBytes, | 89 size_t rowBytes, |
90 int x, | 90 int x, |
91 int y) { | 91 int y) { |
92 return canvas()->writePixels(origInfo, pixels, rowBytes, x, y); | 92 return canvas()->writePixels(origInfo, pixels, rowBytes, x, y); |
93 } | 93 } |
94 | 94 |
95 } // namespace blink | 95 } // namespace blink |
OLD | NEW |