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

Unified Diff: cc/output/gl_renderer.cc

Issue 2175043002: Add command buffer function glScheduleCALayerFilterEffectsCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix autogenerated tests. Created 4 years, 5 months 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 | « cc/DEPS ('k') | gpu/GLES2/extensions/CHROMIUM/CHROMIUM_schedule_ca_layer.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index a5f71599692ba572ef572305cfebfc784ef610f2..3ed0e6e5a1d1030f2ae41306197e9a6d0bc8561c 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -45,6 +45,7 @@
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gpu_memory_allocation.h"
#include "skia/ext/texture_handle.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -3673,6 +3674,26 @@ void GLRenderer::ScheduleCALayers(DrawingFrame* frame) {
ca_layer_overlay.shared_state->opacity, is_clipped, clip_rect,
sorting_context_id, transform);
}
+ if (!ca_layer_overlay.filter_effects.empty()) {
+ std::vector<GLCALayerFilterEffect> effects;
+ effects.resize(ca_layer_overlay.filter_effects.size());
+ for (size_t i = 0; i < ca_layer_overlay.filter_effects.size(); ++i) {
+ const ui::CARendererLayerParams::FilterEffect& filter_effect =
+ ca_layer_overlay.filter_effects[i];
+ GLCALayerFilterEffect& effect = effects[i];
+ effect.type = static_cast<GLint>(filter_effect.type);
+ effect.amount = filter_effect.amount;
+ effect.drop_shadow_offset_x = filter_effect.drop_shadow_offset.x();
+ effect.drop_shadow_offset_y = filter_effect.drop_shadow_offset.y();
+
+ static_assert(sizeof(GLuint) == sizeof(SkColor),
+ "GLuint and SkColor must have the same size.");
+ effect.drop_shadow_color =
+ static_cast<GLuint>(filter_effect.drop_shadow_color);
+ }
+
+ gl_->ScheduleCALayerFilterEffectsCHROMIUM(effects.size(), effects.data());
+ }
gl_->ScheduleCALayerCHROMIUM(
texture_id, contents_rect, ca_layer_overlay.background_color,
ca_layer_overlay.edge_aa_mask, bounds_rect, filter);
« no previous file with comments | « cc/DEPS ('k') | gpu/GLES2/extensions/CHROMIUM/CHROMIUM_schedule_ca_layer.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698