diff options
author | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-19 18:49:16 +0000 |
---|---|---|
committer | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-19 18:49:16 +0000 |
commit | 22c981da75b0251c726f1f3520da8605fa78002a (patch) | |
tree | 49fd6a49f34fdebe4a224e2c24a7c372dff7d19b /o3d | |
parent | 15300d9c5d07f7d49b431890804e07745291bc8b (diff) | |
download | chromium_src-22c981da75b0251c726f1f3520da8605fa78002a.zip chromium_src-22c981da75b0251c726f1f3520da8605fa78002a.tar.gz chromium_src-22c981da75b0251c726f1f3520da8605fa78002a.tar.bz2 |
O2D:
- Fix graphical artifacting for images downloaded from the Internet caused by overwriting them with their own mip-maps. This resulted in each image being rendered with copies of itself of decreasing size in one of the corners. Cairo does not support/need mip-maps, so we now just ignore the calls to set the mip-maps.
- Do not alpha-blend new texture content with the old texture content, which is wrong and would have been wasting a bit of CPU too.
TEST=loaded O2D and verified the artifacting is fixed
BUG=none
Review URL: http://codereview.chromium.org/6268006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/core/cross/cairo/texture_cairo.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/o3d/core/cross/cairo/texture_cairo.cc b/o3d/core/cross/cairo/texture_cairo.cc index 87943f83..476988e 100644 --- a/o3d/core/cross/cairo/texture_cairo.cc +++ b/o3d/core/cross/cairo/texture_cairo.cc @@ -114,6 +114,8 @@ TextureCairo* TextureCairo::Create(ServiceLocator* service_locator, goto fail2; } + cairo_set_operator(image_surface_context, CAIRO_OPERATOR_SOURCE); + return new TextureCairo(service_locator, image_surface, image_surface_context, @@ -154,6 +156,11 @@ void TextureCairo::SetRect(int level, int src_pitch) { DLOG(INFO) << "Texture2DCairo SetRect"; + if (0 != level) { + // Cairo does not support/need mip-maps. + return; + } + // Create image surface to represent the source. cairo_surface_t* source_image_surface = cairo_image_surface_create_for_data( const_cast<unsigned char*>( @@ -175,9 +182,7 @@ void TextureCairo::SetRect(int level, // Discard our reference to the source surface. cairo_surface_destroy(source_image_surface); - if (level == 0) { - TextureUpdated(); - } + TextureUpdated(); } // Locks the given mipmap level of this texture for loading from main memory, |