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

Side by Side Diff: chrome/browser/android/compositor/layer/contextual_search_layer.cc

Issue 925733002: [Contextual Search] Fixing pixel gaps in Search Panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/android/compositor/layer/contextual_search_layer.h" 5 #include "chrome/browser/android/compositor/layer/contextual_search_layer.h"
6 6
7 #include "cc/layers/layer.h" 7 #include "cc/layers/layer.h"
8 #include "cc/layers/nine_patch_layer.h" 8 #include "cc/layers/nine_patch_layer.h"
9 #include "cc/layers/solid_color_layer.h" 9 #include "cc/layers/solid_color_layer.h"
10 #include "cc/layers/ui_resource_layer.h" 10 #include "cc/layers/ui_resource_layer.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 resource_manager_->GetResource(ui::ANDROID_RESOURCE_TYPE_STATIC, 65 resource_manager_->GetResource(ui::ANDROID_RESOURCE_TYPE_STATIC,
66 search_provider_icon_resource_id); 66 search_provider_icon_resource_id);
67 ui::ResourceManager::Resource* search_icon_resource = 67 ui::ResourceManager::Resource* search_icon_resource =
68 resource_manager_->GetResource(ui::ANDROID_RESOURCE_TYPE_STATIC, 68 resource_manager_->GetResource(ui::ANDROID_RESOURCE_TYPE_STATIC,
69 search_icon_resource_id); 69 search_icon_resource_id);
70 70
71 DCHECK(search_bar_background_resource); 71 DCHECK(search_bar_background_resource);
72 DCHECK(search_provider_icon_resource); 72 DCHECK(search_provider_icon_resource);
73 DCHECK(search_icon_resource); 73 DCHECK(search_icon_resource);
74 74
75 // Round values to avoid pixel gap between layers.
76 search_bar_height = floor(search_bar_height);
77 search_bar_margin_top = floor(search_bar_margin_top);
78
75 // --------------------------------------------------------------------------- 79 // ---------------------------------------------------------------------------
76 // Search Bar Background 80 // Search Bar Background
77 // --------------------------------------------------------------------------- 81 // ---------------------------------------------------------------------------
78 gfx::Size background_size(search_panel_width, search_bar_height); 82 gfx::Size background_size(search_panel_width, search_bar_height);
79 search_bar_background_->SetUIResourceId( 83 search_bar_background_->SetUIResourceId(
80 search_bar_background_resource->ui_resource->id()); 84 search_bar_background_resource->ui_resource->id());
81 search_bar_background_->SetBorder( 85 search_bar_background_->SetBorder(
82 search_bar_background_resource->Border(background_size)); 86 search_bar_background_resource->Border(background_size));
83 search_bar_background_->SetAperture(search_bar_background_resource->aperture); 87 search_bar_background_->SetAperture(search_bar_background_resource->aperture);
84 search_bar_background_->SetBounds(background_size); 88 search_bar_background_->SetBounds(background_size);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 266
263 ContextualSearchLayer::~ContextualSearchLayer() { 267 ContextualSearchLayer::~ContextualSearchLayer() {
264 } 268 }
265 269
266 scoped_refptr<cc::Layer> ContextualSearchLayer::layer() { 270 scoped_refptr<cc::Layer> ContextualSearchLayer::layer() {
267 return layer_; 271 return layer_;
268 } 272 }
269 273
270 } // namespace android 274 } // namespace android
271 } // namespace chrome 275 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698