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

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

Issue 183563003: cc: Clean up OcclusionTracker template parameters. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: occlusionparams: Created 6 years, 9 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/image_layer.h ('k') | cc/layers/io_surface_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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/image_layer.h" 5 #include "cc/layers/image_layer.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "cc/resources/image_layer_updater.h" 8 #include "cc/resources/image_layer_updater.h"
9 #include "cc/resources/layer_updater.h" 9 #include "cc/resources/layer_updater.h"
10 #include "cc/resources/prioritized_resource.h" 10 #include "cc/resources/prioritized_resource.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 void ImageLayer::SetTexturePriorities(const PriorityCalculator& priority_calc) { 36 void ImageLayer::SetTexturePriorities(const PriorityCalculator& priority_calc) {
37 // Update the tile data before creating all the layer's tiles. 37 // Update the tile data before creating all the layer's tiles.
38 UpdateTileSizeAndTilingOption(); 38 UpdateTileSizeAndTilingOption();
39 39
40 TiledLayer::SetTexturePriorities(priority_calc); 40 TiledLayer::SetTexturePriorities(priority_calc);
41 } 41 }
42 42
43 bool ImageLayer::Update(ResourceUpdateQueue* queue, 43 bool ImageLayer::Update(ResourceUpdateQueue* queue,
44 const OcclusionTracker* occlusion) { 44 const OcclusionTracker<Layer>* occlusion) {
45 CreateUpdaterIfNeeded(); 45 CreateUpdaterIfNeeded();
46 if (!updater_->UsingBitmap(bitmap_)) { 46 if (!updater_->UsingBitmap(bitmap_)) {
47 updater_->SetBitmap(bitmap_); 47 updater_->SetBitmap(bitmap_);
48 UpdateTileSizeAndTilingOption(); 48 UpdateTileSizeAndTilingOption();
49 InvalidateContentRect(gfx::Rect(content_bounds())); 49 InvalidateContentRect(gfx::Rect(content_bounds()));
50 } 50 }
51 return TiledLayer::Update(queue, occlusion); 51 return TiledLayer::Update(queue, occlusion);
52 } 52 }
53 53
54 void ImageLayer::CreateUpdaterIfNeeded() { 54 void ImageLayer::CreateUpdaterIfNeeded() {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return static_cast<float>(bitmap_.width()) / bounds().width(); 92 return static_cast<float>(bitmap_.width()) / bounds().width();
93 } 93 }
94 94
95 float ImageLayer::ImageContentsScaleY() const { 95 float ImageLayer::ImageContentsScaleY() const {
96 if (bounds().IsEmpty() || bitmap_.height() == 0) 96 if (bounds().IsEmpty() || bitmap_.height() == 0)
97 return 1; 97 return 1;
98 return static_cast<float>(bitmap_.height()) / bounds().height(); 98 return static_cast<float>(bitmap_.height()) / bounds().height();
99 } 99 }
100 100
101 } // namespace cc 101 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/image_layer.h ('k') | cc/layers/io_surface_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698