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

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

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed a signed vs. unsigned comparison in video_resource_updater.cc Created 7 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
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/nine_patch_layer.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 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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() {
55 if (updater_.get()) 55 if (updater_.get())
56 return; 56 return;
57 57
58 updater_ = ImageLayerUpdater::Create(); 58 updater_ = ImageLayerUpdater::Create();
59 GLenum texture_format = 59 SetTextureFormat(
60 layer_tree_host()->GetRendererCapabilities().best_texture_format; 60 layer_tree_host()->GetRendererCapabilities().best_texture_format);
61 SetTextureFormat(texture_format);
62 } 61 }
63 62
64 LayerUpdater* ImageLayer::Updater() const { 63 LayerUpdater* ImageLayer::Updater() const {
65 return updater_.get(); 64 return updater_.get();
66 } 65 }
67 66
68 void ImageLayer::CalculateContentsScale(float ideal_contents_scale, 67 void ImageLayer::CalculateContentsScale(float ideal_contents_scale,
69 float device_scale_factor, 68 float device_scale_factor,
70 float page_scale_factor, 69 float page_scale_factor,
71 bool animating_transform_to_screen, 70 bool animating_transform_to_screen,
(...skipping 15 matching lines...) Expand all
87 return static_cast<float>(bitmap_.width()) / bounds().width(); 86 return static_cast<float>(bitmap_.width()) / bounds().width();
88 } 87 }
89 88
90 float ImageLayer::ImageContentsScaleY() const { 89 float ImageLayer::ImageContentsScaleY() const {
91 if (bounds().IsEmpty() || bitmap_.height() == 0) 90 if (bounds().IsEmpty() || bitmap_.height() == 0)
92 return 1; 91 return 1;
93 return static_cast<float>(bitmap_.height()) / bounds().height(); 92 return static_cast<float>(bitmap_.height()) / bounds().height();
94 } 93 }
95 94
96 } // namespace cc 95 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/nine_patch_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698