Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/gpu_display.cpp
| Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | bool GPUDisplay::update_begin(int texture_width, int texture_height) | ||||
| if (update_state_.is_active) { | if (update_state_.is_active) { | ||||
| LOG(ERROR) << "Attempt to re-activate update process."; | LOG(ERROR) << "Attempt to re-activate update process."; | ||||
| return false; | return false; | ||||
| } | } | ||||
| mutex_.lock(); | mutex_.lock(); | ||||
| texture_state_.size = make_int2(texture_width, texture_height); | |||||
| if (!do_update_begin(texture_width, texture_height)) { | if (!do_update_begin(texture_width, texture_height)) { | ||||
| LOG(ERROR) << "GPUDisplay implementation could not begin update."; | LOG(ERROR) << "GPUDisplay implementation could not begin update."; | ||||
| mutex_.unlock(); | mutex_.unlock(); | ||||
| return false; | return false; | ||||
| } | } | ||||
| update_state_.is_active = true; | update_state_.is_active = true; | ||||
| Show All 10 Lines | void GPUDisplay::update_end() | ||||
| } | } | ||||
| do_update_end(); | do_update_end(); | ||||
| update_state_.is_active = false; | update_state_.is_active = false; | ||||
| mutex_.unlock(); | mutex_.unlock(); | ||||
| } | } | ||||
| int2 GPUDisplay::get_texture_size() const | |||||
| { | |||||
| return texture_state_.size; | |||||
| } | |||||
| /* -------------------------------------------------------------------- | /* -------------------------------------------------------------------- | ||||
| * Texture update from CPU buffer. | * Texture update from CPU buffer. | ||||
| */ | */ | ||||
| void GPUDisplay::copy_pixels_to_texture( | void GPUDisplay::copy_pixels_to_texture( | ||||
| const half4 *rgba_pixels, int texture_x, int texture_y, int pixels_width, int pixels_height) | const half4 *rgba_pixels, int texture_x, int texture_y, int pixels_width, int pixels_height) | ||||
| { | { | ||||
| DCHECK(update_state_.is_active); | DCHECK(update_state_.is_active); | ||||
| ▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines | |||||