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

Unified Diff: cc/layers/nine_patch_layer_impl.cc

Issue 606153004: cc: set blender mode of TextureDrawQuad in nine_patch_layer_impl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_duplicate_code
Patch Set: Fix DCHECK Created 6 years, 1 month 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 | « no previous file | cc/layers/nine_patch_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/nine_patch_layer_impl.cc
diff --git a/cc/layers/nine_patch_layer_impl.cc b/cc/layers/nine_patch_layer_impl.cc
index 1c76d110a9f0e6cf92344c5b50a7167fbf59eafe..0dd2b6fe14ba0652e8af337c62e3b1f974918713 100644
--- a/cc/layers/nine_patch_layer_impl.cc
+++ b/cc/layers/nine_patch_layer_impl.cc
@@ -207,14 +207,14 @@ void NinePatchLayerImpl::AppendQuads(
uv_top.width(),
uv_left.height());
- // Nothing is opaque here.
- // TODO(danakj): Should we look at the SkBitmaps to determine opaqueness?
gfx::Rect opaque_rect;
gfx::Rect visible_rect;
const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ const bool opaque = layer_tree_impl()->IsUIResourceOpaque(ui_resource_id_);
visible_rect =
occlusion_in_content_space.GetUnoccludedContentRect(layer_top_left);
+ opaque_rect = opaque ? visible_rect : gfx::Rect();
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -233,6 +233,7 @@ void NinePatchLayerImpl::AppendQuads(
visible_rect =
occlusion_in_content_space.GetUnoccludedContentRect(layer_top_right);
+ opaque_rect = opaque ? visible_rect : gfx::Rect();
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -251,6 +252,7 @@ void NinePatchLayerImpl::AppendQuads(
visible_rect =
occlusion_in_content_space.GetUnoccludedContentRect(layer_bottom_left);
+ opaque_rect = opaque ? visible_rect : gfx::Rect();
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -269,6 +271,7 @@ void NinePatchLayerImpl::AppendQuads(
visible_rect =
occlusion_in_content_space.GetUnoccludedContentRect(layer_bottom_right);
+ opaque_rect = opaque ? visible_rect : gfx::Rect();
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -286,6 +289,7 @@ void NinePatchLayerImpl::AppendQuads(
}
visible_rect = occlusion_in_content_space.GetUnoccludedContentRect(layer_top);
+ opaque_rect = opaque ? visible_rect : gfx::Rect();
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -304,6 +308,7 @@ void NinePatchLayerImpl::AppendQuads(
visible_rect =
occlusion_in_content_space.GetUnoccludedContentRect(layer_left);
+ opaque_rect = opaque ? visible_rect : gfx::Rect();
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -322,6 +327,7 @@ void NinePatchLayerImpl::AppendQuads(
visible_rect =
occlusion_in_content_space.GetUnoccludedContentRect(layer_right);
+ opaque_rect = opaque ? visible_rect : gfx::Rect();
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -340,6 +346,7 @@ void NinePatchLayerImpl::AppendQuads(
visible_rect =
occlusion_in_content_space.GetUnoccludedContentRect(layer_bottom);
+ opaque_rect = opaque ? visible_rect : gfx::Rect();
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -359,6 +366,7 @@ void NinePatchLayerImpl::AppendQuads(
if (fill_center_) {
visible_rect =
occlusion_in_content_space.GetUnoccludedContentRect(layer_center);
+ opaque_rect = opaque ? visible_rect : gfx::Rect();
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
« no previous file with comments | « no previous file | cc/layers/nine_patch_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698