Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1148)

Unified Diff: core/win/d3d9/texture_d3d9.cc

Issue 5591006: Add an API to allow JavaScript to determine the framerate of individual dynam... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/cross/texture_base.cc ('k') | plugin/idl/texture.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/win/d3d9/texture_d3d9.cc
===================================================================
--- core/win/d3d9/texture_d3d9.cc (revision 66674)
+++ core/win/d3d9/texture_d3d9.cc (working copy)
@@ -260,7 +260,7 @@
}
}
-void SetTextureRect(
+bool SetTextureRect(
ServiceLocator* service_locator,
IDirect3DTexture9* d3d_texture,
Texture::Format format,
@@ -280,7 +280,7 @@
if (!HR(d3d_texture->LockRect(
level, &out_rect, compressed ? NULL : &rect, 0))) {
O3D_ERROR(service_locator) << "Failed to Lock Texture2D (D3D9)";
- return;
+ return false;
}
const uint8* src = static_cast<const uint8*>(src_data);
@@ -294,11 +294,12 @@
}
if (!HR(d3d_texture->UnlockRect(level))) {
O3D_ERROR(service_locator) << "Failed to Unlock Texture2D (D3D9)";
- return;
+ return false;
}
+ return true;
}
-void SetTextureFaceRect(
+bool SetTextureFaceRect(
ServiceLocator* service_locator,
IDirect3DCubeTexture9* d3d_texture,
Texture::Format format,
@@ -321,7 +322,7 @@
if (!HR(d3d_texture->LockRect(
d3d_face, level, &out_rect, compressed ? NULL : &rect, 0))) {
O3D_ERROR(service_locator) << "Failed to Lock TextureCUBE (D3D9)";
- return;
+ return false;
}
const uint8* src = static_cast<const uint8*>(src_data);
@@ -335,8 +336,9 @@
}
if (!HR(d3d_texture->UnlockRect(d3d_face, level))) {
O3D_ERROR(service_locator) << "Failed to Unlock TextureCUBE (D3D9)";
- return;
+ return false;
}
+ return true;
}
} // unnamed namespace
@@ -550,6 +552,7 @@
return;
}
+ bool success = true;
if (resize_to_pot_) {
DCHECK(backing_bitmap_->image_data());
DCHECK(!compressed);
@@ -559,17 +562,20 @@
level, dst_left, dst_top, src_width, src_height, src_data, src_pitch);
UpdateBackedMipLevel(level);
} else {
- SetTextureRect(service_locator(),
- d3d_texture_,
- format(),
- level,
- dst_left,
- dst_top,
- src_width,
- src_height,
- src_data,
- src_pitch);
+ success = SetTextureRect(service_locator(),
+ d3d_texture_,
+ format(),
+ level,
+ dst_left,
+ dst_top,
+ src_width,
+ src_height,
+ src_data,
+ src_pitch);
}
+ if (success && level == 0) {
+ TextureUpdated();
+ }
}
// Locks the given mipmap level of this texture for loading from main memory,
@@ -877,6 +883,7 @@
return;
}
+ bool success = true;
if (resize_to_pot_) {
Bitmap* backing_bitmap = backing_bitmaps_[face].Get();
DCHECK(backing_bitmap->image_data());
@@ -887,18 +894,21 @@
level, dst_left, dst_top, src_width, src_height, src_data, src_pitch);
UpdateBackedMipLevel(face, level);
} else {
- SetTextureFaceRect(service_locator(),
- d3d_cube_texture_,
- format(),
- face,
- level,
- dst_left,
- dst_top,
- src_width,
- src_height,
- src_data,
- src_pitch);
+ success = SetTextureFaceRect(service_locator(),
+ d3d_cube_texture_,
+ format(),
+ face,
+ level,
+ dst_left,
+ dst_top,
+ src_width,
+ src_height,
+ src_data,
+ src_pitch);
}
+ if (success && level == 0) {
+ TextureUpdated();
+ }
}
// Locks the given face and mipmap level of this texture for loading from
« no previous file with comments | « core/cross/texture_base.cc ('k') | plugin/idl/texture.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698