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

Side by Side Diff: cc/layers/scrollbar_layer_impl.cc

Issue 18432002: Blend TextureLayer background-color at draw time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resolved conflicts with TOT Created 7 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 | Annotate | Revision Log
« no previous file with comments | « cc/layers/nine_patch_layer_impl.cc ('k') | cc/layers/texture_layer.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layers/scrollbar_layer_impl.h" 5 #include "cc/layers/scrollbar_layer_impl.h"
6 6
7 #include "cc/animation/scrollbar_animation_controller.h" 7 #include "cc/animation/scrollbar_animation_controller.h"
8 #include "cc/layers/layer.h" 8 #include "cc/layers/layer.h"
9 #include "cc/layers/quad_sink.h" 9 #include "cc/layers/quad_sink.h"
10 #include "cc/quads/solid_color_draw_quad.h" 10 #include "cc/quads/solid_color_draw_quad.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 gfx::Rect opaque_rect; 111 gfx::Rect opaque_rect;
112 const float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; 112 const float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};
113 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); 113 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create();
114 quad->SetNew(shared_quad_state, 114 quad->SetNew(shared_quad_state,
115 thumb_quad_rect, 115 thumb_quad_rect,
116 opaque_rect, 116 opaque_rect,
117 thumb_resource_id_, 117 thumb_resource_id_,
118 premultipled_alpha, 118 premultipled_alpha,
119 uv_top_left, 119 uv_top_left,
120 uv_bottom_right, 120 uv_bottom_right,
121 SK_ColorTRANSPARENT,
121 opacity, 122 opacity,
122 flipped); 123 flipped);
123 quad_sink->Append(quad.PassAs<DrawQuad>(), append_quads_data); 124 quad_sink->Append(quad.PassAs<DrawQuad>(), append_quads_data);
124 } 125 }
125 126
126 if (!track_resource_id_) 127 if (!track_resource_id_)
127 return; 128 return;
128 129
129 // Order matters here: since the back track texture is being drawn to the 130 // Order matters here: since the back track texture is being drawn to the
130 // entire contents rect, we must append it after the thumb and fore track 131 // entire contents rect, we must append it after the thumb and fore track
131 // quads. The back track texture contains (and displays) the buttons. 132 // quads. The back track texture contains (and displays) the buttons.
132 if (!content_bounds_rect.IsEmpty()) { 133 if (!content_bounds_rect.IsEmpty()) {
133 gfx::Rect quad_rect(content_bounds_rect); 134 gfx::Rect quad_rect(content_bounds_rect);
134 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); 135 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect());
135 const float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; 136 const float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};
136 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); 137 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create();
137 quad->SetNew(shared_quad_state, 138 quad->SetNew(shared_quad_state,
138 quad_rect, 139 quad_rect,
139 opaque_rect, 140 opaque_rect,
140 track_resource_id_, 141 track_resource_id_,
141 premultipled_alpha, 142 premultipled_alpha,
142 uv_top_left, 143 uv_top_left,
143 uv_bottom_right, 144 uv_bottom_right,
145 SK_ColorTRANSPARENT,
144 opacity, 146 opacity,
145 flipped); 147 flipped);
146 quad_sink->Append(quad.PassAs<DrawQuad>(), append_quads_data); 148 quad_sink->Append(quad.PassAs<DrawQuad>(), append_quads_data);
147 } 149 }
148 } 150 }
149 151
150 ScrollbarOrientation ScrollbarLayerImpl::Orientation() const { 152 ScrollbarOrientation ScrollbarLayerImpl::Orientation() const {
151 return orientation_; 153 return orientation_;
152 } 154 }
153 155
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 void ScrollbarLayerImpl::DidLoseOutputSurface() { 263 void ScrollbarLayerImpl::DidLoseOutputSurface() {
262 track_resource_id_ = 0; 264 track_resource_id_ = 0;
263 thumb_resource_id_ = 0; 265 thumb_resource_id_ = 0;
264 } 266 }
265 267
266 const char* ScrollbarLayerImpl::LayerTypeAsString() const { 268 const char* ScrollbarLayerImpl::LayerTypeAsString() const {
267 return "cc::ScrollbarLayerImpl"; 269 return "cc::ScrollbarLayerImpl";
268 } 270 }
269 271
270 } // namespace cc 272 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer_impl.cc ('k') | cc/layers/texture_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698