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

Side by Side Diff: ui/compositor/layer.h

Issue 10831396: Remove transitional WEBLAYER_IS_PURE_VIRTUAL code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 4 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 | « ui/compositor/compositor.cc ('k') | ui/compositor/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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_COMPOSITOR_LAYER_H_ 5 #ifndef UI_COMPOSITOR_LAYER_H_
6 #define UI_COMPOSITOR_LAYER_H_ 6 #define UI_COMPOSITOR_LAYER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // Returns true if the layer scales its content. 248 // Returns true if the layer scales its content.
249 bool scale_content() const { return scale_content_; } 249 bool scale_content() const { return scale_content_; }
250 250
251 // Sometimes the Layer is being updated by something other than SetCanvas 251 // Sometimes the Layer is being updated by something other than SetCanvas
252 // (e.g. the GPU process on UI_COMPOSITOR_IMAGE_TRANSPORT). 252 // (e.g. the GPU process on UI_COMPOSITOR_IMAGE_TRANSPORT).
253 bool layer_updated_externally() const { return layer_updated_externally_; } 253 bool layer_updated_externally() const { return layer_updated_externally_; }
254 254
255 // WebContentLayerClient 255 // WebContentLayerClient
256 virtual void paintContents(WebKit::WebCanvas*, 256 virtual void paintContents(WebKit::WebCanvas*,
257 const WebKit::WebRect& clip, 257 const WebKit::WebRect& clip,
258 #if defined(WEBCONTENTLAYERCLIENT_FLOAT_OPAQUE_RECT)
259 WebKit::WebFloatRect& opaque); 258 WebKit::WebFloatRect& opaque);
260 #else
261 WebKit::WebRect& opaque);
262 #endif
263 259
264 #if defined(WEBLAYER_IS_PURE_VIRTUAL)
265 WebKit::WebLayer* web_layer() { return web_layer_; } 260 WebKit::WebLayer* web_layer() { return web_layer_; }
266 #else
267 WebKit::WebLayer web_layer() { return web_layer_; }
268 #endif
269 261
270 float device_scale_factor() const { return device_scale_factor_; } 262 float device_scale_factor() const { return device_scale_factor_; }
271 263
272 // Forces a render surface to be used on this layer. This has no positive 264 // Forces a render surface to be used on this layer. This has no positive
273 // impact, and is only used for benchmarking/testing purpose. 265 // impact, and is only used for benchmarking/testing purpose.
274 void SetForceRenderSurface(bool force); 266 void SetForceRenderSurface(bool force);
275 bool force_render_surface() const { return force_render_surface_; } 267 bool force_render_surface() const { return force_render_surface_; }
276 268
277 private: 269 private:
278 // TODO(vollick): Eventually, if a non-leaf node has an opacity of less than 270 // TODO(vollick): Eventually, if a non-leaf node has an opacity of less than
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 // We keep this reference for the case that if the mask layer gets deleted 365 // We keep this reference for the case that if the mask layer gets deleted
374 // while attached to the main layer before the main layer is deleted. 366 // while attached to the main layer before the main layer is deleted.
375 Layer* layer_mask_back_link_; 367 Layer* layer_mask_back_link_;
376 368
377 std::string name_; 369 std::string name_;
378 370
379 LayerDelegate* delegate_; 371 LayerDelegate* delegate_;
380 372
381 scoped_ptr<LayerAnimator> animator_; 373 scoped_ptr<LayerAnimator> animator_;
382 374
383 #if defined(WEBLAYER_IS_PURE_VIRTUAL)
384 // Ownership of the layer is held through one of the strongly typed layer 375 // Ownership of the layer is held through one of the strongly typed layer
385 // pointers, depending on which sort of layer this is. 376 // pointers, depending on which sort of layer this is.
386 scoped_ptr<WebKit::WebContentLayer> content_layer_; 377 scoped_ptr<WebKit::WebContentLayer> content_layer_;
387 scoped_ptr<WebKit::WebExternalTextureLayer> texture_layer_; 378 scoped_ptr<WebKit::WebExternalTextureLayer> texture_layer_;
388 scoped_ptr<WebKit::WebSolidColorLayer> solid_color_layer_; 379 scoped_ptr<WebKit::WebSolidColorLayer> solid_color_layer_;
389 WebKit::WebLayer* web_layer_; 380 WebKit::WebLayer* web_layer_;
390 #else
391 WebKit::WebLayer web_layer_;
392 #endif
393 bool web_layer_is_accelerated_; 381 bool web_layer_is_accelerated_;
394 bool show_debug_borders_; 382 bool show_debug_borders_;
395 383
396 // If true, the layer scales the canvas and the texture with the device scale 384 // If true, the layer scales the canvas and the texture with the device scale
397 // factor as appropriate. When true, the texture size is in DIP. 385 // factor as appropriate. When true, the texture size is in DIP.
398 bool scale_content_; 386 bool scale_content_;
399 387
400 // A cached copy of |Compositor::device_scale_factor()|. 388 // A cached copy of |Compositor::device_scale_factor()|.
401 float device_scale_factor_; 389 float device_scale_factor_;
402 390
403 DISALLOW_COPY_AND_ASSIGN(Layer); 391 DISALLOW_COPY_AND_ASSIGN(Layer);
404 }; 392 };
405 393
406 } // namespace ui 394 } // namespace ui
407 395
408 #endif // UI_COMPOSITOR_LAYER_H_ 396 #endif // UI_COMPOSITOR_LAYER_H_
OLDNEW
« no previous file with comments | « ui/compositor/compositor.cc ('k') | ui/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698