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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 27 matching lines...) Expand all
38 #include "cc/quads/draw_polygon.h" 38 #include "cc/quads/draw_polygon.h"
39 #include "cc/quads/picture_draw_quad.h" 39 #include "cc/quads/picture_draw_quad.h"
40 #include "cc/quads/render_pass.h" 40 #include "cc/quads/render_pass.h"
41 #include "cc/quads/stream_video_draw_quad.h" 41 #include "cc/quads/stream_video_draw_quad.h"
42 #include "cc/quads/texture_draw_quad.h" 42 #include "cc/quads/texture_draw_quad.h"
43 #include "cc/raster/scoped_gpu_raster.h" 43 #include "cc/raster/scoped_gpu_raster.h"
44 #include "cc/resources/scoped_resource.h" 44 #include "cc/resources/scoped_resource.h"
45 #include "gpu/GLES2/gl2extchromium.h" 45 #include "gpu/GLES2/gl2extchromium.h"
46 #include "gpu/command_buffer/client/context_support.h" 46 #include "gpu/command_buffer/client/context_support.h"
47 #include "gpu/command_buffer/client/gles2_interface.h" 47 #include "gpu/command_buffer/client/gles2_interface.h"
48 #include "gpu/command_buffer/common/gles2_cmd_format.h"
48 #include "gpu/command_buffer/common/gpu_memory_allocation.h" 49 #include "gpu/command_buffer/common/gpu_memory_allocation.h"
49 #include "skia/ext/texture_handle.h" 50 #include "skia/ext/texture_handle.h"
50 #include "third_party/skia/include/core/SkBitmap.h" 51 #include "third_party/skia/include/core/SkBitmap.h"
51 #include "third_party/skia/include/core/SkColor.h" 52 #include "third_party/skia/include/core/SkColor.h"
52 #include "third_party/skia/include/core/SkColorFilter.h" 53 #include "third_party/skia/include/core/SkColorFilter.h"
53 #include "third_party/skia/include/core/SkImage.h" 54 #include "third_party/skia/include/core/SkImage.h"
54 #include "third_party/skia/include/core/SkSurface.h" 55 #include "third_party/skia/include/core/SkSurface.h"
55 #include "third_party/skia/include/gpu/GrContext.h" 56 #include "third_party/skia/include/gpu/GrContext.h"
56 #include "third_party/skia/include/gpu/gl/GrGLInterface.h" 57 #include "third_party/skia/include/gpu/gl/GrGLInterface.h"
57 #include "third_party/skia/include/gpu/gl/GrGLTypes.h" 58 #include "third_party/skia/include/gpu/gl/GrGLTypes.h"
(...skipping 3608 matching lines...) Expand 10 before | Expand all | Expand 10 after
3666 GLfloat transform[16]; 3667 GLfloat transform[16];
3667 ca_layer_overlay.shared_state->transform.asColMajorf(transform); 3668 ca_layer_overlay.shared_state->transform.asColMajorf(transform);
3668 unsigned filter = ca_layer_overlay.filter; 3669 unsigned filter = ca_layer_overlay.filter;
3669 3670
3670 if (ca_layer_overlay.shared_state != shared_state) { 3671 if (ca_layer_overlay.shared_state != shared_state) {
3671 shared_state = ca_layer_overlay.shared_state; 3672 shared_state = ca_layer_overlay.shared_state;
3672 gl_->ScheduleCALayerSharedStateCHROMIUM( 3673 gl_->ScheduleCALayerSharedStateCHROMIUM(
3673 ca_layer_overlay.shared_state->opacity, is_clipped, clip_rect, 3674 ca_layer_overlay.shared_state->opacity, is_clipped, clip_rect,
3674 sorting_context_id, transform); 3675 sorting_context_id, transform);
3675 } 3676 }
3677 if (!ca_layer_overlay.filter_effects.empty()) {
3678 std::vector<GLCALayerFilterEffect> effects;
3679 effects.resize(ca_layer_overlay.filter_effects.size());
3680 for (size_t i = 0; i < ca_layer_overlay.filter_effects.size(); ++i) {
3681 const ui::CARendererLayerParams::FilterEffect& filter_effect =
3682 ca_layer_overlay.filter_effects[i];
3683 GLCALayerFilterEffect& effect = effects[i];
3684 effect.type = static_cast<GLint>(filter_effect.type);
3685 effect.amount = filter_effect.amount;
3686 effect.drop_shadow_offset_x = filter_effect.drop_shadow_offset.x();
3687 effect.drop_shadow_offset_y = filter_effect.drop_shadow_offset.y();
3688
3689 static_assert(sizeof(GLuint) == sizeof(SkColor),
3690 "GLuint and SkColor must have the same size.");
3691 effect.drop_shadow_color =
3692 static_cast<GLuint>(filter_effect.drop_shadow_color);
3693 }
3694
3695 gl_->ScheduleCALayerFilterEffectsCHROMIUM(effects.size(), effects.data());
3696 }
3676 gl_->ScheduleCALayerCHROMIUM( 3697 gl_->ScheduleCALayerCHROMIUM(
3677 texture_id, contents_rect, ca_layer_overlay.background_color, 3698 texture_id, contents_rect, ca_layer_overlay.background_color,
3678 ca_layer_overlay.edge_aa_mask, bounds_rect, filter); 3699 ca_layer_overlay.edge_aa_mask, bounds_rect, filter);
3679 } 3700 }
3680 } 3701 }
3681 3702
3682 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { 3703 void GLRenderer::ScheduleOverlays(DrawingFrame* frame) {
3683 if (frame->overlay_list.empty()) 3704 if (frame->overlay_list.empty())
3684 return; 3705 return;
3685 3706
(...skipping 10 matching lines...) Expand all
3696 texture_id = pending_overlay_resources_.back()->texture_id(); 3717 texture_id = pending_overlay_resources_.back()->texture_id();
3697 } 3718 }
3698 3719
3699 context_support_->ScheduleOverlayPlane( 3720 context_support_->ScheduleOverlayPlane(
3700 overlay.plane_z_order, overlay.transform, texture_id, 3721 overlay.plane_z_order, overlay.transform, texture_id,
3701 ToNearestRect(overlay.display_rect), overlay.uv_rect); 3722 ToNearestRect(overlay.display_rect), overlay.uv_rect);
3702 } 3723 }
3703 } 3724 }
3704 3725
3705 } // namespace cc 3726 } // namespace cc
OLDNEW
« 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