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

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: Addressed comments, added test, dcheck for compressed texture availability 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
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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 DCHECK_EQ(bitmap.bytesPerPixel(), 4); 681 DCHECK_EQ(bitmap.bytesPerPixel(), 4);
682 682
683 SkBitmap bitmap_copy; 683 SkBitmap bitmap_copy;
684 if (bitmap.isImmutable()) { 684 if (bitmap.isImmutable()) {
685 bitmap_copy = bitmap; 685 bitmap_copy = bitmap;
686 } else { 686 } else {
687 bitmap.copyTo(&bitmap_copy, bitmap.config()); 687 bitmap.copyTo(&bitmap_copy, bitmap.config());
688 bitmap_copy.setImmutable(); 688 bitmap_copy.setImmutable();
689 } 689 }
690 690
691 overhang_ui_resource_ = ScopedUIResource::Create( 691 UIResourceBitmap overhang_bitmap(bitmap_copy);
692 this, UIResourceBitmap(bitmap_copy, UIResourceBitmap::REPEAT)); 692 overhang_bitmap.SetWrapMode(UIResourceBitmap::REPEAT);
693 overhang_ui_resource_ = ScopedUIResource::Create(this, overhang_bitmap);
693 } 694 }
694 695
695 void LayerTreeHost::SetVisible(bool visible) { 696 void LayerTreeHost::SetVisible(bool visible) {
696 if (visible_ == visible) 697 if (visible_ == visible)
697 return; 698 return;
698 visible_ = visible; 699 visible_ = visible;
699 if (!visible) 700 if (!visible)
700 ReduceMemoryUsage(); 701 ReduceMemoryUsage();
701 proxy_->SetVisible(visible); 702 proxy_->SetVisible(visible);
702 } 703 }
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 1273
1273 bool LayerTreeHost::ScheduleMicroBenchmark( 1274 bool LayerTreeHost::ScheduleMicroBenchmark(
1274 const std::string& benchmark_name, 1275 const std::string& benchmark_name,
1275 scoped_ptr<base::Value> value, 1276 scoped_ptr<base::Value> value,
1276 const MicroBenchmark::DoneCallback& callback) { 1277 const MicroBenchmark::DoneCallback& callback) {
1277 return micro_benchmark_controller_.ScheduleRun( 1278 return micro_benchmark_controller_.ScheduleRun(
1278 benchmark_name, value.Pass(), callback); 1279 benchmark_name, value.Pass(), callback);
1279 } 1280 }
1280 1281
1281 } // namespace cc 1282 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698