diff options
author | twiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-23 21:54:24 +0000 |
---|---|---|
committer | twiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-23 21:54:24 +0000 |
commit | dff46c1ff17cb55fe7a343de4157d33f3520944e (patch) | |
tree | 26db5af293d812823ea8857cdf3221bcf9c236a7 /skia/ext | |
parent | 67d88652b7d62899a8d7b7149aded7a62b4d3001 (diff) | |
download | chromium_src-dff46c1ff17cb55fe7a343de4157d33f3520944e.zip chromium_src-dff46c1ff17cb55fe7a343de4157d33f3520944e.tar.gz chromium_src-dff46c1ff17cb55fe7a343de4157d33f3520944e.tar.bz2 |
Default initialize CanvasPaintT<T> bitmaps to 0, 0, 0, 0.
PlatformCanvas objects are constructed uninitialized. (Since change http://src.chromium.org/viewvc/chrome?view=rev&revision=127196). This change had propagated uninitialized semantics to CanvasPaint<..>, and CanvasPaintSkia, which introduced the regressions mentioned in the bug below.
This change re-introduces the initilized memory behaviour, but at the CanvasPaint<T> level. This preserves the performance boost from rev 127196, and prevents regressions in displayed UI elements.
Change also removes a now-unnecessary clear in browser_action_button.mm introduced by http://codereview.chromium.org/9839012.
BUG=118755
TEST=None
Review URL: https://chromiumcodereview.appspot.com/9837043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext')
-rw-r--r-- | skia/ext/canvas_paint_gtk.h | 3 | ||||
-rw-r--r-- | skia/ext/canvas_paint_mac.h | 2 | ||||
-rw-r--r-- | skia/ext/canvas_paint_wayland.h | 3 | ||||
-rw-r--r-- | skia/ext/canvas_paint_win.h | 2 | ||||
-rw-r--r-- | skia/ext/canvas_paint_x.h | 3 |
5 files changed, 13 insertions, 0 deletions
diff --git a/skia/ext/canvas_paint_gtk.h b/skia/ext/canvas_paint_gtk.h index ade49af..8060140 100644 --- a/skia/ext/canvas_paint_gtk.h +++ b/skia/ext/canvas_paint_gtk.h @@ -18,6 +18,7 @@ namespace skia { // A class designed to translate skia painting into a region in a GdkWindow. // On construction, it will set up a context for painting into, and on // destruction, it will commit it to the GdkWindow. +// Note: The created context is always inialized to (0, 0, 0, 0). template <class T> class CanvasPaintT : public T { public: @@ -89,6 +90,8 @@ class CanvasPaintT : public T { // Cause a deliberate crash; CHECK(false); } + // No need to clear the canvas, because cairo automatically performs the + // clear. // Need to translate so that the dirty region appears at the origin of the // surface. diff --git a/skia/ext/canvas_paint_mac.h b/skia/ext/canvas_paint_mac.h index d679116..1f5ff03 100644 --- a/skia/ext/canvas_paint_mac.h +++ b/skia/ext/canvas_paint_mac.h @@ -17,6 +17,7 @@ namespace skia { // A class designed to translate skia painting into a region to the current // graphics context. On construction, it will set up a context for painting // into, and on destruction, it will commit it to the current context. +// Note: The created context is always inialized to (0, 0, 0, 0). template <class T> class CanvasPaintT : public T { public: @@ -89,6 +90,7 @@ class CanvasPaintT : public T { // Cause a deliberate crash; *(volatile char*) 0 = 0; } + canvas->clear(SkColorSetARGB(0, 0, 0, 0)); // Need to translate so that the dirty region appears at the origin of the // surface. diff --git a/skia/ext/canvas_paint_wayland.h b/skia/ext/canvas_paint_wayland.h index eca3665..bceb8bb 100644 --- a/skia/ext/canvas_paint_wayland.h +++ b/skia/ext/canvas_paint_wayland.h @@ -15,6 +15,7 @@ namespace skia { // A class designed to translate skia painting into a region in a Wayland window // surface. On construction, it will set up a context for painting into, and on // destruction, it will commit it to the Wayland window surface. +// Note: The created context is always inialized to (0, 0, 0, 0). template <class T> class CanvasPaintT : public T { public: @@ -86,6 +87,8 @@ class CanvasPaintT : public T { // Cause a deliberate crash; CHECK(false); } + // No need to clear the canvas, because cairo automatically performs the + // clear. // Need to translate so that the dirty region appears at the origin of the // surface. diff --git a/skia/ext/canvas_paint_win.h b/skia/ext/canvas_paint_win.h index 9610025..a9651d3 100644 --- a/skia/ext/canvas_paint_win.h +++ b/skia/ext/canvas_paint_win.h @@ -29,6 +29,7 @@ namespace skia { // } // return 0; // } +// Note: The created context is always inialized to (0, 0, 0, 0). template <class T> class CanvasPaintT : public T { public: @@ -113,6 +114,7 @@ class CanvasPaintT : public T { // Cause a deliberate crash; *(char*) 0 = 0; } + canvas->clear(SkColorSetARGB(0, 0, 0, 0)); // This will bring the canvas into the screen coordinate system for the // dirty rect diff --git a/skia/ext/canvas_paint_x.h b/skia/ext/canvas_paint_x.h index e8e3c68..a714a2e 100644 --- a/skia/ext/canvas_paint_x.h +++ b/skia/ext/canvas_paint_x.h @@ -17,6 +17,7 @@ namespace skia { // A class designed to translate skia painting into a region in a Wayland window // surface. On construction, it will set up a context for painting into, and on // destruction, it will commit it to the Wayland window surface. +// Note: The created context is always inialized to (0, 0, 0, 0). template <class T> class CanvasPaintT : public T { public: @@ -88,6 +89,8 @@ class CanvasPaintT : public T { // Cause a deliberate crash; CHECK(false); } + // No need to clear the canvas, because cairo automatically performs the + // clear. // Need to translate so that the dirty region appears at the origin of the // surface. |