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

Side by Side Diff: cc/trees/layer_tree_host.cc

Issue 27973002: cc: Adding ETC1 support to UIResourceBitmap and ResourceProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: latest comments Created 7 years, 2 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/scheduler/texture_uploader.cc ('k') | cc/trees/layer_tree_host_impl_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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <stack> 8 #include <stack>
9 #include <string> 9 #include <string>
10 10
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 DCHECK_EQ(bitmap.bytesPerPixel(), 4); 686 DCHECK_EQ(bitmap.bytesPerPixel(), 4);
687 687
688 SkBitmap bitmap_copy; 688 SkBitmap bitmap_copy;
689 if (bitmap.isImmutable()) { 689 if (bitmap.isImmutable()) {
690 bitmap_copy = bitmap; 690 bitmap_copy = bitmap;
691 } else { 691 } else {
692 bitmap.copyTo(&bitmap_copy, bitmap.config()); 692 bitmap.copyTo(&bitmap_copy, bitmap.config());
693 bitmap_copy.setImmutable(); 693 bitmap_copy.setImmutable();
694 } 694 }
695 695
696 overhang_ui_resource_ = ScopedUIResource::Create( 696 UIResourceBitmap overhang_bitmap(bitmap_copy);
697 this, UIResourceBitmap(bitmap_copy, UIResourceBitmap::REPEAT)); 697 overhang_bitmap.SetWrapMode(UIResourceBitmap::REPEAT);
698 overhang_ui_resource_ = ScopedUIResource::Create(this, overhang_bitmap);
698 } 699 }
699 700
700 void LayerTreeHost::SetVisible(bool visible) { 701 void LayerTreeHost::SetVisible(bool visible) {
701 if (visible_ == visible) 702 if (visible_ == visible)
702 return; 703 return;
703 visible_ = visible; 704 visible_ = visible;
704 if (!visible) 705 if (!visible)
705 ReduceMemoryUsage(); 706 ReduceMemoryUsage();
706 proxy_->SetVisible(visible); 707 proxy_->SetVisible(visible);
707 } 708 }
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 1278
1278 bool LayerTreeHost::ScheduleMicroBenchmark( 1279 bool LayerTreeHost::ScheduleMicroBenchmark(
1279 const std::string& benchmark_name, 1280 const std::string& benchmark_name,
1280 scoped_ptr<base::Value> value, 1281 scoped_ptr<base::Value> value,
1281 const MicroBenchmark::DoneCallback& callback) { 1282 const MicroBenchmark::DoneCallback& callback) {
1282 return micro_benchmark_controller_.ScheduleRun( 1283 return micro_benchmark_controller_.ScheduleRun(
1283 benchmark_name, value.Pass(), callback); 1284 benchmark_name, value.Pass(), callback);
1284 } 1285 }
1285 1286
1286 } // namespace cc 1287 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/texture_uploader.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698