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

Unified Diff: content/common/gpu/image_transport_surface_win.cc

Issue 9192014: Replace WGC3D visibility extension with resource_usage extension. [Part 2 of 3] (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added image_transport_surface_win changes Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/image_transport_surface_linux.cc ('k') | content/renderer/gpu/command_buffer_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/image_transport_surface_win.cc
diff --git a/content/common/gpu/image_transport_surface_win.cc b/content/common/gpu/image_transport_surface_win.cc
index 9a8e549a72ff014d93a3ee4d655457ce70e712f1..b6fe4def84f26e99f05652715926cdeb34c86709 100644
--- a/content/common/gpu/image_transport_surface_win.cc
+++ b/content/common/gpu/image_transport_surface_win.cc
@@ -40,7 +40,7 @@ class PbufferImageTransportSurface
virtual bool SwapBuffers() OVERRIDE;
virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
virtual std::string GetExtensions() OVERRIDE;
- virtual void SetVisible(bool visible) OVERRIDE;
+ virtual void SetResourceUsage(ResourceUsage resourceUsage) OVERRIDE;
protected:
// ImageTransportSurface implementation
@@ -121,16 +121,21 @@ bool PbufferImageTransportSurface::PostSubBuffer(
return false;
}
-void PbufferImageTransportSurface::SetVisible(bool visible) {
- if (visible == is_visible_)
- return;
-
- is_visible_ = visible;
-
- if (visible)
- Resize(visible_size_);
- else
- Resize(gfx::Size(1, 1));
+void PbufferImageTransportSurface::SetResourceUsage(
+ ResourceUsage resourceUsage) {
+ switch (resourceUsage) {
+ case RESOURCE_USAGE_FULL:
+ Resize(visible_size_);
+ is_visible_ = true;
+ break;
+ case RESOURCE_USAGE_LESS:
+ Resize(gfx::Size(1, 1));
+ is_visible_ = false;
+ break;
+ case RESOURCE_USAGE_NONE:
+ // TODO(mmocny): drop all the buffers
+ break;
+ }
}
std::string PbufferImageTransportSurface::GetExtensions() {
« no previous file with comments | « content/common/gpu/image_transport_surface_linux.cc ('k') | content/renderer/gpu/command_buffer_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698