OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1905 ////////////////////////////////////////////////////////////////////////////// | 1905 ////////////////////////////////////////////////////////////////////////////// |
1906 | 1906 |
1907 void SkCanvas::clear(SkColor color) { | 1907 void SkCanvas::clear(SkColor color) { |
1908 SkDrawIter iter(this); | 1908 SkDrawIter iter(this); |
1909 this->predrawNotify(); | 1909 this->predrawNotify(); |
1910 while (iter.next()) { | 1910 while (iter.next()) { |
1911 iter.fDevice->clear(color); | 1911 iter.fDevice->clear(color); |
1912 } | 1912 } |
1913 } | 1913 } |
1914 | 1914 |
| 1915 void SkCanvas::onDiscard() { |
| 1916 if (NULL != fSurfaceBase) { |
| 1917 fSurfaceBase->aboutToDraw(SkSurface::kDiscard_ContentChangeMode); |
| 1918 } |
| 1919 } |
| 1920 |
1915 void SkCanvas::drawPaint(const SkPaint& paint) { | 1921 void SkCanvas::drawPaint(const SkPaint& paint) { |
1916 this->internalDrawPaint(paint); | 1922 this->internalDrawPaint(paint); |
1917 } | 1923 } |
1918 | 1924 |
1919 void SkCanvas::internalDrawPaint(const SkPaint& paint) { | 1925 void SkCanvas::internalDrawPaint(const SkPaint& paint) { |
1920 CHECK_SHADER_NOSETCONTEXT(paint); | 1926 CHECK_SHADER_NOSETCONTEXT(paint); |
1921 | 1927 |
1922 LOOPER_BEGIN(paint, SkDrawFilter::kPaint_Type, NULL) | 1928 LOOPER_BEGIN(paint, SkDrawFilter::kPaint_Type, NULL) |
1923 | 1929 |
1924 while (iter.next()) { | 1930 while (iter.next()) { |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2642 if (!bitmap.installPixels(info, pixels, rowBytes)) { | 2648 if (!bitmap.installPixels(info, pixels, rowBytes)) { |
2643 return NULL; | 2649 return NULL; |
2644 } | 2650 } |
2645 | 2651 |
2646 // should this functionality be moved into allocPixels()? | 2652 // should this functionality be moved into allocPixels()? |
2647 if (!bitmap.info().isOpaque()) { | 2653 if (!bitmap.info().isOpaque()) { |
2648 bitmap.eraseColor(0); | 2654 bitmap.eraseColor(0); |
2649 } | 2655 } |
2650 return SkNEW_ARGS(SkCanvas, (bitmap)); | 2656 return SkNEW_ARGS(SkCanvas, (bitmap)); |
2651 } | 2657 } |
OLD | NEW |