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

Side by Side Diff: ui/gfx/compositor/layer.cc

Issue 7552039: Vend common GL context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer comments. Created 9 years, 3 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 | « ui/gfx/compositor/compositor_win.cc ('k') | views/view_unittest.cc » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/gfx/compositor/layer.h" 5 #include "ui/gfx/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 for (Layer* layer = this; layer; layer = layer->parent_) { 85 for (Layer* layer = this; layer; layer = layer->parent_) {
86 texture_draw_params.transform.ConcatTransform(layer->transform_); 86 texture_draw_params.transform.ConcatTransform(layer->transform_);
87 texture_draw_params.transform.ConcatTranslate( 87 texture_draw_params.transform.ConcatTranslate(
88 static_cast<float>(layer->bounds_.x()), 88 static_cast<float>(layer->bounds_.x()),
89 static_cast<float>(layer->bounds_.y())); 89 static_cast<float>(layer->bounds_.y()));
90 } 90 }
91 91
92 // Only blend for transparent child layers. 92 // Only blend for transparent child layers.
93 // The root layer will clobber the cleared bg. 93 // The root layer will clobber the cleared bg.
94 texture_draw_params.blend = parent_ != NULL && !fills_bounds_opaquely_; 94 texture_draw_params.blend = parent_ != NULL && !fills_bounds_opaquely_;
95 texture_draw_params.compositor_size = compositor_->size();
95 96
96 #if defined(OS_WIN) 97 #if defined(OS_WIN)
97 texture_->Draw(texture_draw_params); 98 texture_->Draw(texture_draw_params);
98 #else 99 #else
99 hole_rect_ = hole_rect_.Intersect( 100 hole_rect_ = hole_rect_.Intersect(
100 gfx::Rect(0, 0, bounds_.width(), bounds_.height())); 101 gfx::Rect(0, 0, bounds_.width(), bounds_.height()));
101 102
102 // top 103 // top
103 DrawRegion(texture_draw_params, gfx::Rect(0, 104 DrawRegion(texture_draw_params, gfx::Rect(0,
104 0, 105 0,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 !children_[i]->transform().HasChange()) { 138 !children_[i]->transform().HasChange()) {
138 hole_rect_ = children_[i]->bounds(); 139 hole_rect_ = children_[i]->bounds();
139 return; 140 return;
140 } 141 }
141 } 142 }
142 // no opaque child layers, set hole_rect_ to empty 143 // no opaque child layers, set hole_rect_ to empty
143 hole_rect_ = gfx::Rect(); 144 hole_rect_ = gfx::Rect();
144 } 145 }
145 146
146 } // namespace ui 147 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/compositor/compositor_win.cc ('k') | views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698